Run rustfmt; add FIXME
This commit is contained in:
parent
d9691ca6d2
commit
2c42798bc3
|
@ -19,11 +19,12 @@ use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
use registry::Registry;
|
use registry::Registry;
|
||||||
|
|
||||||
|
mod registry;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref REGISTRY: Arc<Mutex<Registry>> = Arc::new(Mutex::new(Registry::default()));
|
static ref REGISTRY: Arc<Mutex<Registry>> = Arc::new(Mutex::new(Registry::default()));
|
||||||
}
|
}
|
||||||
|
|
||||||
mod registry;
|
|
||||||
fn main() -> Result<(), Error> {
|
fn main() -> Result<(), Error> {
|
||||||
let matches = App::new("Music Sync")
|
let matches = App::new("Music Sync")
|
||||||
.version("0.1.0")
|
.version("0.1.0")
|
||||||
|
@ -86,6 +87,7 @@ fn select_albums(ui: &mut Cursive) {
|
||||||
let added_albums = registry.added_albums();
|
let added_albums = registry.added_albums();
|
||||||
let existing_albums = registry.existing_albums();
|
let existing_albums = registry.existing_albums();
|
||||||
let removed_albums = registry.removed_albums();
|
let removed_albums = registry.removed_albums();
|
||||||
|
// FIXME: Use a custom view for this.
|
||||||
let list_view = ListView::new()
|
let list_view = ListView::new()
|
||||||
.with(|list_view| {
|
.with(|list_view| {
|
||||||
list_view.add_child("--- New", Checkbox::new().disabled());
|
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);
|
list_view.add_child(album_name(album_path), checkbox);
|
||||||
}
|
}
|
||||||
})
|
}).scrollable();
|
||||||
.scrollable();
|
|
||||||
|
|
||||||
ui.pop_layer();
|
ui.pop_layer();
|
||||||
ui.add_layer(
|
ui.add_layer(
|
||||||
|
|
|
@ -23,12 +23,11 @@ impl Registry {
|
||||||
.max_depth(2);
|
.max_depth(2);
|
||||||
let dir_filter = |entry: &DirEntry| {
|
let dir_filter = |entry: &DirEntry| {
|
||||||
// The entry should be a directory and its name should not start with "extra"
|
// 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.metadata().map(|e| e.is_dir()).unwrap_or(false) && !entry
|
||||||
&& !entry
|
.file_name()
|
||||||
.file_name()
|
.to_str()
|
||||||
.to_str()
|
.map(|s| s.starts_with("extra"))
|
||||||
.map(|s| s.starts_with("extra"))
|
.unwrap_or(true)
|
||||||
.unwrap_or(true)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for entry in dir_walker.into_iter().filter_entry(dir_filter) {
|
for entry in dir_walker.into_iter().filter_entry(dir_filter) {
|
||||||
|
|
Reference in New Issue