diff options
| author | Michael Lamparski <diagonaldevice@gmail.com> | 2018-03-17 20:02:55 -0400 |
|---|---|---|
| committer | Michael Lamparski <diagonaldevice@gmail.com> | 2018-03-17 20:08:07 -0400 |
| commit | 7cbc93b14f0c5b39003a95f6cfbb74bd4fa04f40 (patch) | |
| tree | 65e18f2cfbe7ebf17b4f932520c9870ee00731a8 /src/libstd/path.rs | |
| parent | 0d0a470b89df7b859ce048e29873621c957e29d8 (diff) | |
| download | rust-7cbc93b14f0c5b39003a95f6cfbb74bd4fa04f40.tar.gz rust-7cbc93b14f0c5b39003a95f6cfbb74bd4fa04f40.zip | |
elide elidable lifetime in Path::strip_prefix
Diffstat (limited to 'src/libstd/path.rs')
| -rw-r--r-- | src/libstd/path.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 527246fe1cd..c624a0b2a2f 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1880,15 +1880,15 @@ impl Path { /// assert_eq!(path.strip_prefix(prefix), Ok(Path::new("haha/foo.txt"))); /// ``` #[stable(since = "1.7.0", feature = "path_strip_prefix")] - pub fn strip_prefix<'a, P>(&'a self, base: P) - -> Result<&'a Path, StripPrefixError> + pub fn strip_prefix<P>(&self, base: P) + -> Result<&Path, StripPrefixError> where P: AsRef<Path> { self._strip_prefix(base.as_ref()) } - fn _strip_prefix<'a>(&'a self, base: &Path) - -> Result<&'a Path, StripPrefixError> { + fn _strip_prefix(&self, base: &Path) + -> Result<&Path, StripPrefixError> { iter_after(self.components(), base.components()) .map(|c| c.as_path()) .ok_or(StripPrefixError(())) |
