@@ 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)
}