Switch to the 2018 edition; fix some warnings

This commit is contained in:
Paul van Tilburg 2019-03-27 21:50:03 +01:00
parent 5cdb16b708
commit e8943b30c9
3 changed files with 5 additions and 13 deletions

View File

@ -2,10 +2,11 @@
name = "music-sync"
version = "0.1.0"
authors = ["Paul van Tilburg <paul@luon.net>"]
edition = "2018"
[dependencies]
clap = "2.32.0"
cursive = "0.9.0"
failure = "0.1.2"
lazy_static = "1"
walkdir = "2"
walkdir = "2"

View File

@ -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);
});

View File

@ -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));
}