We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Path::strip_prefix
1 parent b54770c commit f82c984Copy full SHA for f82c984
src/libstd/path.rs
@@ -1582,8 +1582,10 @@ impl Path {
1582
1583
/// Returns a path that, when joined onto `base`, yields `self`.
1584
///
1585
+ /// # Errors
1586
+ ///
1587
/// If `base` is not a prefix of `self` (i.e. `starts_with`
- /// returns false), then `relative_from` returns `None`.
1588
+ /// returns `false`), returns `Err`.
1589
#[stable(since = "1.7.0", feature = "path_strip_prefix")]
1590
pub fn strip_prefix<'a, P: ?Sized>(&'a self, base: &'a P)
1591
-> Result<&'a Path, StripPrefixError>
0 commit comments