Rollup merge of #133602 - SanchithHegde:fix-pathbuf-example-codeblocks, r=cuviper
fix: fix codeblocks in `PathBuf` example This PR adds missing codeblocks around an example included in the `PathBuf` documentation.
This commit is contained in:
commit
61d50fd0ac
1 changed files with 2 additions and 0 deletions
|
@ -1158,6 +1158,7 @@ impl FusedIterator for Ancestors<'_> {}
|
||||||
/// Note that `PathBuf` does not always sanitize arguments, for example
|
/// Note that `PathBuf` does not always sanitize arguments, for example
|
||||||
/// [`push`] allows paths built from strings which include separators:
|
/// [`push`] allows paths built from strings which include separators:
|
||||||
///
|
///
|
||||||
|
/// ```
|
||||||
/// use std::path::PathBuf;
|
/// use std::path::PathBuf;
|
||||||
///
|
///
|
||||||
/// let mut path = PathBuf::new();
|
/// let mut path = PathBuf::new();
|
||||||
|
@ -1166,6 +1167,7 @@ impl FusedIterator for Ancestors<'_> {}
|
||||||
/// path.push("windows");
|
/// path.push("windows");
|
||||||
/// path.push(r"..\otherdir");
|
/// path.push(r"..\otherdir");
|
||||||
/// path.push("system32");
|
/// path.push("system32");
|
||||||
|
/// ```
|
||||||
///
|
///
|
||||||
/// The behavior of `PathBuf` may be changed to a panic on such inputs
|
/// The behavior of `PathBuf` may be changed to a panic on such inputs
|
||||||
/// in the future. [`Extend::extend`] should be used to add multi-part paths.
|
/// in the future. [`Extend::extend`] should be used to add multi-part paths.
|
||||||
|
|
Loading…
Add table
Reference in a new issue