mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Fix new clippy errors
This commit is contained in:
@@ -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
@@ -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:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user