Remove abmiguity from PathBuf pop example

This commit is contained in:
Ivan Tham 2020-08-08 18:28:55 +08:00 committed by GitHub
parent d19d7e2755
commit 4b15b809eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1232,10 +1232,10 @@ impl PathBuf {
/// ```
/// use std::path::{Path, PathBuf};
///
/// let mut p = PathBuf::from("/test/test.rs");
/// let mut p = PathBuf::from("/spirited/away.rs");
///
/// p.pop();
/// assert_eq!(Path::new("/test"), p);
/// assert_eq!(Path::new("/spirited"), p);
/// p.pop();
/// assert_eq!(Path::new("/"), p);
/// ```