Skip to content

Commit b984134

Browse files
authored
Do not clone paths while walking dirs (#693)
1 parent 416ba82 commit b984134

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

notify/src/inotify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ impl EventLoop {
404404
.into_iter()
405405
.filter_map(filter_dir)
406406
{
407-
self.add_single_watch(entry.path().to_path_buf(), is_recursive, watch_self)?;
407+
self.add_single_watch(entry.into_path(), is_recursive, watch_self)?;
408408
watch_self = false;
409409
}
410410

notify/src/kqueue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl EventLoop {
303303
.into_iter()
304304
{
305305
let entry = entry.map_err(map_walkdir_error)?;
306-
self.add_single_watch(entry.path().to_path_buf(), is_recursive)?;
306+
self.add_single_watch(entry.into_path(), is_recursive)?;
307307
}
308308
}
309309

@@ -347,7 +347,7 @@ impl EventLoop {
347347
.follow_links(self.follow_symlinks)
348348
.into_iter()
349349
{
350-
let p = entry.map_err(map_walkdir_error)?.path().to_path_buf();
350+
let p = entry.map_err(map_walkdir_error)?.into_path();
351351
self.kqueue
352352
.remove_filename(&p, EventFilter::EVFILT_VNODE)
353353
.map_err(|e| Error::io(e).add_path(p))?;

0 commit comments

Comments
 (0)