mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 05:45:19 +01:00
xtask: Cargo clippy lints
This commit is contained in:
parent
9bc60cc5ed
commit
38cba9f3ad
3 changed files with 19 additions and 24 deletions
|
|
@ -117,7 +117,7 @@ impl core::fmt::Display for CargoCommand<'_> {
|
||||||
if let Some(package) = p {
|
if let Some(package) = p {
|
||||||
format!("package {package}")
|
format!("package {package}")
|
||||||
} else {
|
} else {
|
||||||
format!("default package")
|
"default package".to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,15 +125,15 @@ impl core::fmt::Display for CargoCommand<'_> {
|
||||||
if let Some(features) = f {
|
if let Some(features) = f {
|
||||||
format!("\"{features}\"")
|
format!("\"{features}\"")
|
||||||
} else {
|
} else {
|
||||||
format!("no features")
|
"no features".to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn carg(f: &&Option<&str>) -> String {
|
fn carg(f: &&Option<&str>) -> String {
|
||||||
if let Some(cargoarg) = f {
|
if let Some(cargoarg) = f {
|
||||||
format!("{cargoarg}")
|
cargoarg.to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("no cargo args")
|
"no cargo args".to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,25 +152,25 @@ impl core::fmt::Display for CargoCommand<'_> {
|
||||||
let path = path.to_str().unwrap_or("<can't display>");
|
let path = path.to_str().unwrap_or("<can't display>");
|
||||||
format!("in {path}")
|
format!("in {path}")
|
||||||
} else {
|
} else {
|
||||||
format!("")
|
"".to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
let target = if let Some(target) = target {
|
let target = if let Some(target) = target {
|
||||||
format!("{target}")
|
format!("{target}")
|
||||||
} else {
|
} else {
|
||||||
format!("<no explicit target>")
|
"<no explicit target>".to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
let mode = if let Some(mode) = mode {
|
let mode = if let Some(mode) = mode {
|
||||||
format!("{mode}")
|
format!("{mode}")
|
||||||
} else {
|
} else {
|
||||||
format!("debug")
|
"debug".to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
let deny_warnings = if deny_warnings {
|
let deny_warnings = if deny_warnings {
|
||||||
format!("deny warnings, ")
|
"deny warnings, ".to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("")
|
"".to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
if cargoarg.is_some() && path.is_some() {
|
if cargoarg.is_some() && path.is_some() {
|
||||||
|
|
@ -299,7 +299,7 @@ impl core::fmt::Display for CargoCommand<'_> {
|
||||||
let carg = if cargoarg.is_some() {
|
let carg = if cargoarg.is_some() {
|
||||||
format!("(cargo args: {carg})")
|
format!("(cargo args: {carg})")
|
||||||
} else {
|
} else {
|
||||||
format!("")
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
if *check_only {
|
if *check_only {
|
||||||
|
|
@ -321,9 +321,9 @@ impl core::fmt::Display for CargoCommand<'_> {
|
||||||
.map(|a| format!("{a}"))
|
.map(|a| format!("{a}"))
|
||||||
.unwrap_or_else(|| "no extra arguments".into());
|
.unwrap_or_else(|| "no extra arguments".into());
|
||||||
let deny_warnings = if *deny_warnings {
|
let deny_warnings = if *deny_warnings {
|
||||||
format!("deny warnings, ")
|
"deny warnings, ".to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("")
|
String::new()
|
||||||
};
|
};
|
||||||
if cargoarg.is_some() {
|
if cargoarg.is_some() {
|
||||||
write!(f, "Document ({deny_warnings}{feat}, {carg}, {arguments})")
|
write!(f, "Document ({deny_warnings}{feat}, {carg}, {arguments})")
|
||||||
|
|
@ -371,13 +371,13 @@ impl<'a> CargoCommand<'a> {
|
||||||
let env = if let Some((key, value)) = self.extra_env() {
|
let env = if let Some((key, value)) = self.extra_env() {
|
||||||
format!("{key}=\"{value}\" ")
|
format!("{key}=\"{value}\" ")
|
||||||
} else {
|
} else {
|
||||||
format!("")
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
let cd = if let Some(Some(chdir)) = self.chdir().map(|p| p.to_str()) {
|
let cd = if let Some(Some(chdir)) = self.chdir().map(|p| p.to_str()) {
|
||||||
format!("cd {chdir} && ")
|
format!("cd {chdir} && ")
|
||||||
} else {
|
} else {
|
||||||
format!("")
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
let executable = self.executable();
|
let executable = self.executable();
|
||||||
|
|
@ -445,7 +445,7 @@ impl<'a> CargoCommand<'a> {
|
||||||
args.extend_from_slice(&["--features", features]);
|
args.extend_from_slice(&["--features", features]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(mode) = mode.map(|m| m.to_flag()).flatten() {
|
if let Some(mode) = mode.and_then(|m| m.to_flag()) {
|
||||||
args.push(mode);
|
args.push(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -753,10 +753,7 @@ impl<'a> CargoCommand<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_stdout_intermediate(&self) -> bool {
|
pub fn print_stdout_intermediate(&self) -> bool {
|
||||||
match self {
|
matches!(self, Self::ExampleSize { .. })
|
||||||
Self::ExampleSize { .. } => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,11 +89,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
);
|
);
|
||||||
log::debug!("Partial features: {}", globals.partial);
|
log::debug!("Partial features: {}", globals.partial);
|
||||||
|
|
||||||
let platform = if let Some(platform) = globals.platform {
|
let platform = globals.platform.unwrap_or_default();
|
||||||
platform
|
|
||||||
} else {
|
|
||||||
Platforms::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
let backend = if let Some(backend) = globals.backend {
|
let backend = if let Some(backend) = globals.backend {
|
||||||
backend
|
backend
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ pub trait CoalescingRunner<'c> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "rayon"))]
|
#[cfg(not(feature = "rayon"))]
|
||||||
|
#[allow(clippy::module_inception)]
|
||||||
mod iter {
|
mod iter {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{argument_parsing::Globals, cargo_command::*, run::run_and_convert};
|
use crate::{argument_parsing::Globals, cargo_command::*, run::run_and_convert};
|
||||||
|
|
@ -28,6 +29,7 @@ mod iter {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "rayon")]
|
#[cfg(feature = "rayon")]
|
||||||
|
#[allow(clippy::module_inception)]
|
||||||
mod iter {
|
mod iter {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{argument_parsing::Globals, cargo_command::*, run::run_and_convert};
|
use crate::{argument_parsing::Globals, cargo_command::*, run::run_and_convert};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue