chore: handle current compiler & clippy warnings (#7051)

This commit is contained in:
David Knaack
2025-10-25 09:41:31 +02:00
committed by GitHub
parent fe4abb605f
commit 8258063791
6 changed files with 12 additions and 17 deletions
+2 -7
View File
@@ -625,9 +625,10 @@ mod tests {
pub switch_c: Switch,
}
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone, Default)]
enum Switch {
On,
#[default]
Off,
}
@@ -644,12 +645,6 @@ mod tests {
}
}
impl Default for Switch {
fn default() -> Self {
Self::Off
}
}
let config = toml::toml! {
switch_a = "on"
switch_b = "any"
+3 -3
View File
@@ -552,9 +552,9 @@ impl DirContents {
{
let worker = move || {
let enumerated_dir = fs::read_dir(base).unwrap().enumerate();
let _ = enumerated_dir
.filter_map(|(_, entry)| entry.ok())
let dir_iter = fs::read_dir(base).unwrap();
let _ = dir_iter
.filter_map(|entry| entry.ok())
.try_for_each(|entry| tx.send(entry));
};
+1 -1
View File
@@ -22,7 +22,7 @@ pub enum FormatElement<'a> {
Text(Cow<'a, str>),
Variable(Cow<'a, str>),
TextGroup(TextGroup<'a>),
Conditional(Vec<FormatElement<'a>>),
Conditional(Vec<Self>),
}
#[derive(Clone)]
+4 -3
View File
@@ -391,9 +391,10 @@ impl<'a> StringFormatter<'a> {
match format_element {
// Should not usually happen, but if it does, check if the variable
// is set using `should_show_elements`.
FormatElement::Variable(_) => {
should_show_elements(&[format_element.clone()], variables)
}
FormatElement::Variable(_) => should_show_elements(
std::slice::from_ref(format_element),
variables,
),
FormatElement::Conditional(format) => {
should_show_elements(format, variables)
}
+1 -2
View File
@@ -306,8 +306,7 @@ fn get_latest_sdk_from_cli(context: &Context) -> Option<String> {
.stdout
.lines()
.map(str::trim)
.filter(|l| !l.is_empty())
.next_back()
.rfind(|l| !l.is_empty())
.or_else(parse_failed)?;
let take_until = latest_sdk.find('[').or_else(parse_failed)? - 1;
if take_until > 1 {
+1 -1
View File
@@ -51,7 +51,7 @@ mod normalize {
}
#[cfg(windows)]
pub fn normalize_path(path: &Path) -> (NormalizedPrefix, &Path) {
pub fn normalize_path(path: &Path) -> (NormalizedPrefix<'_>, &Path) {
let mut components = path.components();
if let Some(Component::Prefix(prefix)) = components.next() {
return (normalize_prefix(prefix.kind()), components.as_path());