Run rustfmt; add FIXME

This commit is contained in:
Paul van Tilburg 2018-09-21 21:23:06 +02:00
parent d9691ca6d2
commit 2c42798bc3
2 changed files with 9 additions and 9 deletions

View File

@ -19,11 +19,12 @@ use std::sync::{Arc, Mutex};
use registry::Registry;
mod registry;
lazy_static! {
static ref REGISTRY: Arc<Mutex<Registry>> = Arc::new(Mutex::new(Registry::default()));
}
mod registry;
fn main() -> Result<(), Error> {
let matches = App::new("Music Sync")
.version("0.1.0")
@ -86,6 +87,7 @@ fn select_albums(ui: &mut Cursive) {
let added_albums = registry.added_albums();
let existing_albums = registry.existing_albums();
let removed_albums = registry.removed_albums();
// FIXME: Use a custom view for this.
let list_view = ListView::new()
.with(|list_view| {
list_view.add_child("--- New", Checkbox::new().disabled());
@ -122,8 +124,7 @@ fn select_albums(ui: &mut Cursive) {
}
list_view.add_child(album_name(album_path), checkbox);
}
})
.scrollable();
}).scrollable();
ui.pop_layer();
ui.add_layer(

View File

@ -23,12 +23,11 @@ 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) {