mirror of
https://github.com/numtide/treefmt.git
synced 2024-09-11 17:07:44 +03:00
address clippy warnings
This commit is contained in:
parent
ec77b3f710
commit
77f45d6cd5
@ -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(())
|
||||
}
|
||||
|
@ -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)),
|
||||
};
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user