forked from NationTech/harmony
chore: reformat & clippy cleanup (#96)
Clippy is now added to the `check` in the pipeline Co-authored-by: Ian Letourneau <letourneau.ian@gmail.com> Reviewed-on: NationTech/harmony#96
This commit is contained in:
@@ -2,7 +2,7 @@ use harmony::instrumentation::{self, HarmonyEvent};
|
||||
use indicatif::{MultiProgress, ProgressBar};
|
||||
use indicatif_log_bridge::LogWrapper;
|
||||
use std::{
|
||||
collections::{HashMap, hash_map},
|
||||
collections::HashMap,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ pub mod progress;
|
||||
pub mod theme;
|
||||
|
||||
#[cfg(feature = "tui")]
|
||||
use harmony_tui;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
pub struct Args {
|
||||
@@ -73,7 +71,7 @@ fn maestro_scores_filter<T: Topology>(
|
||||
}
|
||||
};
|
||||
|
||||
return scores_vec;
|
||||
scores_vec
|
||||
}
|
||||
|
||||
// TODO: consider adding doctest for this function
|
||||
@@ -83,7 +81,7 @@ fn list_scores_with_index<T: Topology>(scores_vec: &Vec<Box<dyn Score<T>>>) -> S
|
||||
let name = s.name();
|
||||
display_str.push_str(&format!("\n{i}: {name}"));
|
||||
}
|
||||
return display_str;
|
||||
display_str
|
||||
}
|
||||
|
||||
pub async fn run<T: Topology + Send + Sync + 'static>(
|
||||
@@ -126,7 +124,7 @@ async fn init<T: Topology + Send + Sync + 'static>(
|
||||
|
||||
let scores_vec = maestro_scores_filter(&maestro, args.all, args.filter, args.number);
|
||||
|
||||
if scores_vec.len() == 0 {
|
||||
if scores_vec.is_empty() {
|
||||
return Err("No score found".into());
|
||||
}
|
||||
|
||||
@@ -265,7 +263,7 @@ mod test {
|
||||
|
||||
assert!(
|
||||
maestro
|
||||
.interpret(res.get(0).unwrap().clone_box())
|
||||
.interpret(res.first().unwrap().clone_box())
|
||||
.await
|
||||
.is_ok()
|
||||
);
|
||||
@@ -281,7 +279,7 @@ mod test {
|
||||
|
||||
assert!(
|
||||
maestro
|
||||
.interpret(res.get(0).unwrap().clone_box())
|
||||
.interpret(res.first().unwrap().clone_box())
|
||||
.await
|
||||
.is_err()
|
||||
);
|
||||
@@ -297,7 +295,7 @@ mod test {
|
||||
|
||||
assert!(
|
||||
maestro
|
||||
.interpret(res.get(0).unwrap().clone_box())
|
||||
.interpret(res.first().unwrap().clone_box())
|
||||
.await
|
||||
.is_ok()
|
||||
);
|
||||
@@ -319,7 +317,7 @@ mod test {
|
||||
|
||||
assert!(
|
||||
maestro
|
||||
.interpret(res.get(0).unwrap().clone_box())
|
||||
.interpret(res.first().unwrap().clone_box())
|
||||
.await
|
||||
.is_ok()
|
||||
);
|
||||
@@ -331,6 +329,6 @@ mod test {
|
||||
|
||||
let res = crate::maestro_scores_filter(&maestro, false, None, 11);
|
||||
|
||||
assert!(res.len() == 0);
|
||||
assert!(res.is_empty());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user