Fix new clippy errors

This commit is contained in:
Oliver Hamlet
2026-06-22 17:57:15 +01:00
parent 212ded640e
commit fbc62d50c3
2 changed files with 12 additions and 14 deletions
+1 -3
View File
@@ -612,9 +612,7 @@ fn read_struct_size(buffer: &[u8]) -> Result<usize, String> {
buffer
.first_chunk::<2>()
.map(|c| usize::from(u16::from_le_bytes(*c)))
.ok_or_else(
|| format!("The buffer was too small to hold a struct size field: {buffer:X?}",),
)
.ok_or_else(|| format!("The buffer was too small to hold a struct size field: {buffer:X?}"))
}
// <https://learn.microsoft.com/en-us/windows/win32/menurc/stringtable>
+11 -11
View File
@@ -412,7 +412,7 @@ mod tests {
match result.0.as_slice() {
[CompoundCondition(_), CompoundCondition(_)] => {}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -463,10 +463,10 @@ mod tests {
[Condition::Function(_)],
[Condition::Function(_), Condition::Function(_)],
) => {}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -478,7 +478,7 @@ mod tests {
[Condition::Function(Function::FilePath(f))] => {
assert_eq!(&PathBuf::from("Cargo.toml"), f);
}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -494,7 +494,7 @@ mod tests {
assert_eq!(&PathBuf::from("Cargo.toml"), f1);
assert_eq!(&PathBuf::from("README.md"), f2);
}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -506,7 +506,7 @@ mod tests {
Condition::Function(Function::FilePath(f)) => {
assert_eq!(PathBuf::from("Cargo.toml"), f);
}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -518,7 +518,7 @@ mod tests {
Condition::InvertedFunction(Function::FilePath(f)) => {
assert_eq!(PathBuf::from("Cargo.toml"), f);
}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -528,7 +528,7 @@ mod tests {
match result {
Condition::Expression(_) => {}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -538,7 +538,7 @@ mod tests {
match result {
Condition::Expression(_) => {}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -548,7 +548,7 @@ mod tests {
match result {
Condition::InvertedExpression(_) => {}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}
@@ -560,7 +560,7 @@ mod tests {
match result {
Condition::InvertedExpression(_) => {}
v => panic!("Expected an expression with two compound conditions, got {v:?}",),
v => panic!("Expected an expression with two compound conditions, got {v:?}"),
}
}