mirror of
https://github.com/BurntSushi/walkdir.git
synced 2025-10-01 15:40:33 +00:00
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:
parent
26dc0f584b
commit
73eb575162
@ -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.
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user