Skip to content

Commit 28ab318

Browse files
authored
Rollup merge of #75285 - pickfire:patch-8, r=jonas-schievink
Separate example for Path strip_prefix
2 parents 27b864b + 6dffd2d commit 28ab318

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/std/src/path.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,8 +2060,9 @@ impl Path {
20602060
/// assert_eq!(path.strip_prefix("/test/"), Ok(Path::new("haha/foo.txt")));
20612061
/// assert_eq!(path.strip_prefix("/test/haha/foo.txt"), Ok(Path::new("")));
20622062
/// assert_eq!(path.strip_prefix("/test/haha/foo.txt/"), Ok(Path::new("")));
2063-
/// assert_eq!(path.strip_prefix("test").is_ok(), false);
2064-
/// assert_eq!(path.strip_prefix("/haha").is_ok(), false);
2063+
///
2064+
/// assert!(path.strip_prefix("test").is_err());
2065+
/// assert!(path.strip_prefix("/haha").is_err());
20652066
///
20662067
/// let prefix = PathBuf::from("/test/");
20672068
/// assert_eq!(path.strip_prefix(prefix), Ok(Path::new("haha/foo.txt")));

0 commit comments

Comments
 (0)