mirror of
https://github.com/nivekuil/rip
synced 2024-11-10 06:04:17 +00:00
Fix filter logic (!= to ==)
This commit is contained in:
parent
f8fcab8e3b
commit
8349842d8a
2 changed files with 12 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "rm-improved"
|
||||
version = "0.10.1"
|
||||
version = "0.10.2"
|
||||
authors = ["mail@nivekuil.com"]
|
||||
description = "rip: a safety-focused alternative to rm."
|
||||
repository = "https://github.com/nivekuil/rip"
|
||||
|
|
22
src/main.rs
22
src/main.rs
|
@ -361,19 +361,19 @@ fn get_last_bury<R: AsRef<Path>>(record: R) -> io::Result<String> {
|
|||
// This could be cleaned up more if/when for loops can return a value
|
||||
for entry in contents.lines().rev()
|
||||
.map(record_entry)
|
||||
.filter(|x| x.user != get_user()) {
|
||||
// Check that the file is still in the graveyard.
|
||||
// If it is, return the corresponding line.
|
||||
if symlink_exists(entry.dest) {
|
||||
if !graves_to_exhume.is_empty() {
|
||||
delete_lines_from_record(&f, record, &graves_to_exhume)?;
|
||||
.filter(|x| x.user == get_user()) {
|
||||
// Check that the file is still in the graveyard.
|
||||
// If it is, return the corresponding line.
|
||||
if symlink_exists(entry.dest) {
|
||||
if !graves_to_exhume.is_empty() {
|
||||
delete_lines_from_record(&f, record, &graves_to_exhume)?;
|
||||
}
|
||||
return Ok(String::from(entry.dest))
|
||||
} else {
|
||||
// File is gone, mark the grave to be removed from the record
|
||||
graves_to_exhume.push(String::from(entry.dest));
|
||||
}
|
||||
return Ok(String::from(entry.dest))
|
||||
} else {
|
||||
// File is gone, mark the grave to be removed from the record
|
||||
graves_to_exhume.push(String::from(entry.dest));
|
||||
}
|
||||
}
|
||||
|
||||
if !graves_to_exhume.is_empty() {
|
||||
delete_lines_from_record(&f, record, &graves_to_exhume)?;
|
||||
|
|
Loading…
Reference in a new issue