Run rustfmt

This commit is contained in:
Paul van Tilburg 2018-08-24 21:20:52 +02:00
parent 056e1c388b
commit 83ec82ec54
2 changed files with 13 additions and 10 deletions

View File

@ -57,7 +57,8 @@ fn load_albums(ui: &mut Cursive) {
let cb = ui.cb_sink().clone();
ui.add_layer(
Dialog::around(ProgressBar::new()
Dialog::around(
ProgressBar::new()
.range(0, registry.albums_list.len())
.with_task(move |counter| {
let mut registry = REGISTRY.lock().unwrap();
@ -67,7 +68,8 @@ fn load_albums(ui: &mut Cursive) {
} else {
cb.send(Box::new(select_albums));
}
})).title("Loading list of albums…"),
}),
).title("Loading list of albums…"),
);
}
@ -120,7 +122,8 @@ fn select_albums(ui: &mut Cursive) {
}
list_view.add_child(album_name(album_path), checkbox);
}
}).scrollable();
})
.scrollable();
ui.pop_layer();
ui.add_layer(
@ -141,8 +144,7 @@ fn save_albums(ui: &mut Cursive) {
ui.pop_layer();
ui.add_layer(
Dialog::around(TextView::new("All albums have been saved!"))
.button("Ok", |ui| ui.quit())
Dialog::around(TextView::new("All albums have been saved!")).button("Ok", |ui| ui.quit()),
);
}

View File

@ -23,11 +23,12 @@ impl Registry {
.max_depth(2);
let dir_filter = |entry: &DirEntry| {
// The entry should be a directory and its name should not start with "extra"
entry.metadata().map(|e| e.is_dir()).unwrap_or(false) && !entry
.file_name()
.to_str()
.map(|s| s.starts_with("extra"))
.unwrap_or(true)
entry.metadata().map(|e| e.is_dir()).unwrap_or(false)
&& !entry
.file_name()
.to_str()
.map(|s| s.starts_with("extra"))
.unwrap_or(true)
};
for entry in dir_walker.into_iter().filter_entry(dir_filter) {