Refactor with the help of Clippy (#462)

We add clippy as our build — also rectifying the missing `plume-cli` build!

In the next step we follow clippy's advise and fix some of the "simple" mistakes in our code, such as style or map usage.

Finally, we refactor some hard bits that need extraction of new types, or refactoring of function call-types, especially those that thread thru macros, and, of course functions with ~15 parameters should probably be rethought.
This commit is contained in:
Igor Galić
2019-03-19 14:37:56 +01:00
committed by Baptiste Gelez
parent 570d7fe2d0
commit 732f514da7
34 changed files with 393 additions and 297 deletions
+1 -9
View File
@@ -60,13 +60,7 @@ fn init<'a>(args: &ArgMatches<'a>, conn: &Connection) {
let path = Path::new(path).join("search_index");
let can_do = match read_dir(path.clone()) { // try to read the directory specified
Ok(mut contents) => {
if contents.next().is_none() {
true
} else {
false
}
},
Ok(mut contents) => contents.next().is_none(),
Err(e) => if e.kind() == ErrorKind::NotFound {
true
} else {
@@ -107,5 +101,3 @@ fn unlock<'a>(args: &ArgMatches<'a>) {
remove_file(path).unwrap();
}