about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-03-11 10:55:31 -0700
committerBrian Anderson <banderson@mozilla.com>2015-03-23 10:22:17 -0700
commit9ec9bc68fb310aac29e984d26cc37952de328f1e (patch)
tree6cc829eea2a0557ed45d8677a6237b66a1d7bf54 /src/libstd/path.rs
parent2625bf9ae4a46000ae3a138f938f8f1dd3c095a8 (diff)
downloadrust-9ec9bc68fb310aac29e984d26cc37952de328f1e.tar.gz
rust-9ec9bc68fb310aac29e984d26cc37952de328f1e.zip
Clarify behavior of Path::relative_from
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index ddceed14cc6..05c7761be7b 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