Run clippy

main
trivernis 2 years ago
parent 6ede8a3df6
commit 558a9c3282
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -23,7 +23,7 @@ impl VersionError {
let mut pos = (0, src.len()).into(); let mut pos = (0, src.len()).into();
let clean_src = src.trim_start_matches('^'); let clean_src = src.trim_start_matches('^');
if let Some((arg_str, arg_pos)) = find_in_args(&clean_src) { if let Some((arg_str, arg_pos)) = find_in_args(clean_src) {
pos = arg_pos; pos = arg_pos;
src = arg_str; src = arg_str;
} }
@ -183,6 +183,6 @@ pub fn find_in_args(query: &str) -> Option<(String, SourceSpan)> {
let args_string = std::env::args().fold(String::new(), |s, acc| format!("{s} {acc}")); let args_string = std::env::args().fold(String::new(), |s, acc| format!("{s} {acc}"));
args_string args_string
.find(&query) .find(query)
.map(|index| (args_string, (index, query.len()).into())) .map(|index| (args_string, (index, query.len()).into()))
} }

@ -73,7 +73,7 @@ pub async fn map_direct(paths: Vec<PathBuf>) -> Result<()> {
.await; .await;
results results
.into_iter() .into_iter()
.fold(Result::Ok(()), |acc, res| acc.and_then(|_| res))?; .fold(Result::Ok(()), |acc, res| acc.and(res))?;
Ok(()) Ok(())
} }

@ -138,7 +138,7 @@ impl Repository {
})) }))
.await .await
.into_iter() .into_iter()
.fold(Result::Ok(()), |acc, res| acc.and_then(|_| res)) .fold(Result::Ok(()), |acc, res| acc.and(res))
.into_diagnostic() .into_diagnostic()
.wrap_err("Failed to create application directory")?; .wrap_err("Failed to create application directory")?;
@ -167,7 +167,7 @@ impl Repository {
self.installed_versions self.installed_versions
.all() .all()
.into_iter() .into_iter()
.map(|v| v.clone().into()) .map(|v| (*v).into())
.collect() .collect()
} }

Loading…
Cancel
Save