Rollup merge of #31733 - gkoz:strip_prefix_docs, r=alexcrichton

It wasn't fixed after copy-pasting. This probably needs to be backported to beta.
This commit is contained in:
Steve Klabnik 2016-02-17 18:14:36 -05:00
commit 27ede43c89
1 changed files with 3 additions and 1 deletions

View File

@ -1582,8 +1582,10 @@ impl Path {
/// Returns a path that, when joined onto `base`, yields `self`.
///
/// # Errors
///
/// If `base` is not a prefix of `self` (i.e. `starts_with`
/// returns false), then `relative_from` returns `None`.
/// returns `false`), returns `Err`.
#[stable(since = "1.7.0", feature = "path_strip_prefix")]
pub fn strip_prefix<'a, P: ?Sized>(&'a self, base: &'a P)
-> Result<&'a Path, StripPrefixError>