bugfix for nonexisting trashed item paths
Build/Publish XBPS / build-and-publish (push) Successful in 11s
Details
Build/Publish XBPS / build-and-publish (push) Successful in 11s
Details
This commit is contained in:
parent
32b34f634c
commit
877e9f952c
|
@ -31,7 +31,11 @@ fn list<P: Fn(&trash::TrashItem) -> bool>(predicate: P) -> Vec<trash::TrashItem>
|
||||||
fn print_list(path: Option<PathBuf>) {
|
fn print_list(path: Option<PathBuf>) {
|
||||||
let predicate: Box<dyn Fn(&trash::TrashItem) -> bool> = match &path {
|
let predicate: Box<dyn Fn(&trash::TrashItem) -> bool> = match &path {
|
||||||
Some(p) => Box::new(|item| {
|
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),
|
None => Box::new(|_| true),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue