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:
Matthias Krüger 2024-12-01 08:15:23 +01:00 committed by GitHub
commit 61d50fd0ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1158,6 +1158,7 @@ impl FusedIterator for Ancestors<'_> {}
/// Note that `PathBuf` does not always sanitize arguments, for example
/// [`push`] allows paths built from strings which include separators:
///
/// ```
/// use std::path::PathBuf;
///
/// let mut path = PathBuf::new();
@ -1166,6 +1167,7 @@ impl FusedIterator for Ancestors<'_> {}
/// path.push("windows");
/// path.push(r"..\otherdir");
/// path.push("system32");
/// ```
///
/// 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.