address clippy warnings

This commit is contained in:
zimbatm 2021-02-22 15:57:50 +01:00
parent ec77b3f710
commit 77f45d6cd5
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
3 changed files with 5 additions and 6 deletions

View File

@ -50,7 +50,7 @@ pub fn format_cmd(work_dir: PathBuf) -> anyhow::Result<()> {
fs::create_dir_all(&cache_dir)?;
// Finally run the main formatter logic from the engine.
run_treefmt(work_dir.to_path_buf(), cache_dir, treefmt_toml)?;
run_treefmt(work_dir, cache_dir, treefmt_toml)?;
Ok(())
}

View File

@ -76,7 +76,6 @@ pub fn from_path(file_path: &PathBuf) -> Result<Root> {
// Re-add the resolved formatter if it was successful
Ok(fmt2) => {
sum.insert(name.clone(), fmt2);
()
}
Err(err) => CLOG.warn(&format!("Ignoring {} because of error: {}", name, err)),
};

View File

@ -42,7 +42,7 @@ pub fn create_manifest(
})
.collect();
let manifest_toml = RootManifest {
manifest: map_manifest.clone(),
manifest: map_manifest,
};
f.write_all(
format!(
@ -108,12 +108,12 @@ pub fn check_treefmt(
) -> Result<Vec<CmdContext>> {
let cache_context = cache.manifest.values();
let map_ctx: BTreeMap<String, CmdContext> = cmd_context
.into_iter()
.iter()
.map(|cmd| {
let name = cmd.name.clone();
let ctx = CmdContext {
name: cmd.name.clone(),
mtime: cmd.mtime.clone(),
mtime: cmd.mtime,
path: cmd.path.clone(),
work_dir: cmd.work_dir.clone(),
options: cmd.options.clone(),
@ -130,7 +130,7 @@ pub fn check_treefmt(
Ok(CmdContext {
name: new.name.clone(),
path: new.path.clone(),
mtime: new.mtime.clone(),
mtime: new.mtime,
work_dir: new.work_dir.clone(),
options: new.options.clone(),
metadata: if new.path != old.path