add DirEntry::into_path

This can avoid an allocation and copy in iterator chains that need to
produce a PathBuf.
This commit is contained in:
Ruud van Asseldonk 2018-04-09 23:35:43 +02:00
parent 26dc0f584b
commit 73eb575162

View File

@ -968,6 +968,15 @@ impl DirEntry {
&self.path
}
/// The full path that this entry represents.
///
/// Analogous to [`path`], but moves ownership of the path.
///
/// [`path`]: struct.DirEntry.html#method.path
pub fn into_path(self) -> PathBuf {
self.path
}
/// Returns `true` if and only if this entry was created from a symbolic
/// link. This is unaffected by the [`follow_links`] setting.
///