Skip to content

Commit 6dffd2d

Browse files
authored
Separate example for Path strip_prefix
1 parent d19d7e2 commit 6dffd2d

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
@@ -2053,8 +2053,9 @@ impl Path {
20532053
/// assert_eq!(path.strip_prefix("/test/"), Ok(Path::new("haha/foo.txt")));
20542054
/// assert_eq!(path.strip_prefix("/test/haha/foo.txt"), Ok(Path::new("")));
20552055
/// assert_eq!(path.strip_prefix("/test/haha/foo.txt/"), Ok(Path::new("")));
2056-
/// assert_eq!(path.strip_prefix("test").is_ok(), false);
2057-
/// assert_eq!(path.strip_prefix("/haha").is_ok(), false);
2056+
///
2057+
/// assert!(path.strip_prefix("test").is_err());
2058+
/// assert!(path.strip_prefix("/haha").is_err());
20582059
///
20592060
/// let prefix = PathBuf::from("/test/");
20602061
/// assert_eq!(path.strip_prefix(prefix), Ok(Path::new("haha/foo.txt")));

0 commit comments

Comments
 (0)