fix: fix codeblocks in PathBuf example

This commit is contained in:
Sanchith Hegde 2024-11-29 03:50:26 +05:30
parent a2545fd6fc
commit d599d5a381
No known key found for this signature in database
GPG Key ID: 909C6EA799D40276

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.