Skip to content

Commit 9ec9bc6

Browse files
committed
Clarify behavior of Path::relative_from
1 parent 2625bf9 commit 9ec9bc6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libstd/path.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ impl Path {
12431243
}
12441244

12451245
/// Returns a path that, when joined onto `base`, yields `self`.
1246+
///
1247+
/// If `base` is not a prefix of `self` (i.e. `starts_with`
1248+
/// returns false), then `relative_from` returns `None`.
12461249
#[unstable(feature = "path_relative_from", reason = "see #23284")]
12471250
pub fn relative_from<'a, P: ?Sized>(&'a self, base: &'a P) -> Option<&Path> where
12481251
P: AsPath

0 commit comments

Comments
 (0)