Switch to the 2018 edition; fix some warnings
This commit is contained in:
parent
5cdb16b708
commit
e8943b30c9
|
@ -2,6 +2,7 @@
|
|||
name = "music-sync"
|
||||
version = "0.1.0"
|
||||
authors = ["Paul van Tilburg <paul@luon.net>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.32.0"
|
||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -1,18 +1,9 @@
|
|||
#![allow(unknown_lints)]
|
||||
#![warn(clippy)]
|
||||
|
||||
extern crate clap;
|
||||
extern crate cursive;
|
||||
extern crate failure;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate walkdir;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use cursive::traits::*;
|
||||
use cursive::views::{Checkbox, Dialog, ListView, ProgressBar, TextView};
|
||||
use cursive::Cursive;
|
||||
use failure::Error;
|
||||
use lazy_static::lazy_static;
|
||||
use std::ffi::OsStr;
|
||||
use std::os::unix::process::CommandExt;
|
||||
use std::path::PathBuf;
|
||||
|
@ -97,7 +88,7 @@ fn select_albums(ui: &mut Cursive) {
|
|||
let album_name = album_name(&album_path);
|
||||
let album_path = album_path.clone();
|
||||
|
||||
let mut checkbox = Checkbox::new().on_change(move |_, checked| {
|
||||
let checkbox = Checkbox::new().on_change(move |_, checked| {
|
||||
let mut registry = REGISTRY.lock().unwrap();
|
||||
registry.select_album(&album_path, checked);
|
||||
});
|
||||
|
|
|
@ -50,7 +50,7 @@ impl Registry {
|
|||
let line_filter = |line: &&str| line.ends_with("***");
|
||||
|
||||
for line in contents.lines().filter(line_filter) {
|
||||
let path = line.trim_left_matches('#').trim_right_matches("/***");
|
||||
let path = line.trim_start_matches('#').trim_end_matches("/***");
|
||||
if !line.starts_with('#') {
|
||||
self.selected_albums.insert(PathBuf::from(path));
|
||||
}
|
||||
|
|
Reference in New Issue