Clippy
This commit is contained in:
@@ -88,6 +88,7 @@ fn main_inner() -> Result<ExitCode> {
|
||||
let max_tasks = manifest.config.threads.map(|x| x.get()).unwrap_or(1);
|
||||
|
||||
debug!("Starting runtime with {max_tasks} threads");
|
||||
#[expect(clippy::unwrap_used)]
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.worker_threads(3)
|
||||
.max_blocking_threads(max_tasks)
|
||||
@@ -116,12 +117,13 @@ fn main_inner() -> Result<ExitCode> {
|
||||
});
|
||||
|
||||
if js.len() >= max_tasks {
|
||||
#[expect(clippy::unwrap_used)]
|
||||
js.join_next().await.unwrap()??;
|
||||
}
|
||||
}
|
||||
|
||||
while let Some(x) = js.join_next().await {
|
||||
x.unwrap()?
|
||||
x??
|
||||
}
|
||||
|
||||
return Ok::<_, Error>(());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use anyhow::{Result, bail};
|
||||
use anyhow::{bail, Result};
|
||||
use regex::Regex;
|
||||
use tracing::warn;
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ impl Iterator for PickRuleIterator<'_> {
|
||||
match value {
|
||||
PickRule::Plain(task) => {
|
||||
let mut patterns = current.prefix.clone();
|
||||
patterns.push(key.to_string());
|
||||
patterns.push(key.to_owned());
|
||||
|
||||
Some(FlatPickRule {
|
||||
patterns,
|
||||
@@ -199,7 +199,7 @@ impl Iterator for PickRuleIterator<'_> {
|
||||
}
|
||||
PickRule::Nested(nested_rules) => {
|
||||
let mut prefix = current.prefix.clone();
|
||||
prefix.push(key.to_string());
|
||||
prefix.push(key.to_owned());
|
||||
|
||||
self.stack.push(PickRuleIterState {
|
||||
rules: nested_rules,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use anyhow::{Context, Result, bail};
|
||||
use anyhow::{bail, Context, Result};
|
||||
use indicatif::ProgressBar;
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
use tracing::{error, trace};
|
||||
use walkdir::WalkDir;
|
||||
|
||||
use crate::{Cli, manifest::types::Manifest, style::spinner_style_list, tool::TaskContext};
|
||||
use crate::{manifest::types::Manifest, style::spinner_style_list, tool::TaskContext, Cli};
|
||||
|
||||
pub fn load_manifest(cli: &Cli) -> Result<Manifest> {
|
||||
let manifest_path_str = cli
|
||||
|
||||
@@ -34,7 +34,7 @@ impl PickTool for ToolBash {
|
||||
debug!("Running `before` script");
|
||||
let mut temp_file =
|
||||
tempfile::NamedTempFile::new().context("while creating temporary script")?;
|
||||
writeln!(temp_file, "{}", script).context("while creating temporary script")?;
|
||||
writeln!(temp_file, "{script}").context("while creating temporary script")?;
|
||||
temp_file
|
||||
}
|
||||
};
|
||||
@@ -82,7 +82,7 @@ impl PickTool for ToolBash {
|
||||
debug!("Running `after` script");
|
||||
let mut temp_file =
|
||||
tempfile::NamedTempFile::new().context("while creating temporary script")?;
|
||||
writeln!(temp_file, "{}", script).context("while creating temporary script")?;
|
||||
writeln!(temp_file, "{script}").context("while creating temporary script")?;
|
||||
temp_file
|
||||
}
|
||||
};
|
||||
@@ -131,7 +131,7 @@ impl PickTool for ToolBash {
|
||||
trace!("Running script for {}: {}", ctx.path_rel_str, ctx.task);
|
||||
let mut temp_file =
|
||||
tempfile::NamedTempFile::new().context("while creating temporary script")?;
|
||||
writeln!(temp_file, "{}", script).context("while creating temporary script")?;
|
||||
writeln!(temp_file, "{script}").context("while creating temporary script")?;
|
||||
temp_file
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user