~llndqvst/notmuch-mvrs

c9d0f1aff772878fe2ad5f312aa0bc0f2f752079 — Lukas Lindqvist 5 months ago ae973f7
Fix formating
2 files changed, 15 insertions(+), 8 deletions(-)

M src/movers/mbsync.rs
M tests/test.rs
M src/movers/mbsync.rs => src/movers/mbsync.rs +14 -6
@@ 39,7 39,11 @@ impl Mbsync {
        let mut f = from.clone();
        if f.pop() {
            let maildir_parent = f.file_name().unwrap();
            println!("target: {}, maildir_parent: {}", self.target_path.to_str().unwrap(), maildir_parent.to_str().unwrap());
            println!(
                "target: {}, maildir_parent: {}",
                self.target_path.to_str().unwrap(),
                maildir_parent.to_str().unwrap()
            );
            (from, self.target_path.join(maildir_parent).join(new_name))
        } else {
            println!("target: {}, ", self.target_path.to_str().unwrap());


@@ 63,10 67,9 @@ impl Mover<PathBuf> for Mbsync {
            let ct = to.clone();
            println!("{} -> {}", from.to_str().unwrap(), to.to_str().unwrap());
            match rename(from, to) {
                Ok(_) => (),
                Ok(_) => self.moved = self.moved + 1,
                Err(e) => eprintln!("{}, {}", ct.to_str().unwrap(), e.to_string()),
            }
            self.moved = self.moved + 1;
        }
        Ok(self.moved)
    }


@@ 75,10 78,15 @@ impl Mover<PathBuf> for Mbsync {
        while let Some(y) = self.original_files.pop_front() {
            let (from, to): (PathBuf, PathBuf) = self.get_rename_pair(y);
            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()),
                true => println!(
                    "{}: already at desired location. Skipping",
                    from.to_str().unwrap()
                ),
                false => {
                    self.moved = self.moved + 1;
                    println!("{} -> {}", from.to_str().unwrap(), to.to_str().unwrap())
                }
            };
            self.moved = self.moved + 1;
        }
        Ok(self.moved)
    }

M tests/test.rs => tests/test.rs +1 -2
@@ 1,5 1,4 @@
#[cfg(test)]
mod tests {
use notmuch_mvrs;
    use notmuch_mvrs;
}