From 9ec9bc68fb310aac29e984d26cc37952de328f1e Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 11 Mar 2015 10:55:31 -0700 Subject: [PATCH] Clarify behavior of Path::relative_from --- src/libstd/path.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libstd/path.rs b/src/libstd/path.rs index ddceed14cc6c..05c7761be7b5 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1243,6 +1243,9 @@ impl Path { } /// Returns a path that, when joined onto `base`, yields `self`. + /// + /// If `base` is not a prefix of `self` (i.e. `starts_with` + /// returns false), then `relative_from` returns `None`. #[unstable(feature = "path_relative_from", reason = "see #23284")] pub fn relative_from<'a, P: ?Sized>(&'a self, base: &'a P) -> Option<&Path> where P: AsPath