Run rustfmt; add FIXME

master
Paul van Tilburg 4 years ago
parent d9691ca6d2
commit 2c42798bc3
  1. 7
      src/main.rs
  2. 11
      src/registry.rs

@ -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(

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