~llndqvst/notmuch-mvrs

1f51690732533ac4228d8cb7d3bdb4d2d4f4de04 — Lukas Lindqvist 6 months ago 1e8fe2d
Added check to mbsync dry run if from and to are the same location
1 files changed, 4 insertions(+), 1 deletions(-)

M src/movers/mbsync.rs
M src/movers/mbsync.rs => src/movers/mbsync.rs +4 -1
@@ 67,7 67,10 @@ impl Mover<PathBuf> for Mbsync {
    fn dry_rename(&mut self) -> Result<i32, &str> {
        while let Some(y) = self.original_files.pop_front() {
            let (from, to): (PathBuf, PathBuf) = self.get_rename_pair(y);
            println!("{} -> {}", from.to_str().unwrap(), to.to_str().unwrap());
            match from.eq(&to) {
                true => println!("{}: already at desired location. Skipping", from.to_str().unwrap()),
                false => println!("{} -> {}", from.to_str().unwrap(), to.to_str().unwrap()),
            };
            self.moved = self.moved + 1;
        }
        Ok(self.moved)