parent
32b34f634c
commit
877e9f952c
1 changed files with 5 additions and 1 deletions
|
@ -31,7 +31,11 @@ fn list<P: Fn(&trash::TrashItem) -> bool>(predicate: P) -> Vec<trash::TrashItem>
|
|||
fn print_list(path: Option<PathBuf>) {
|
||||
let predicate: Box<dyn Fn(&trash::TrashItem) -> bool> = match &path {
|
||||
Some(p) => Box::new(|item| {
|
||||
*p.canonicalize().unwrap() == item.original_parent.canonicalize().unwrap()
|
||||
let orig = match item.original_parent.canonicalize() {
|
||||
Ok(p) => p,
|
||||
Err(_) => item.original_parent.clone(),
|
||||
};
|
||||
*p.canonicalize().unwrap() == orig
|
||||
}),
|
||||
None => Box::new(|_| true),
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue