[domistream] Tests: first compile, clippy clean
Temporaries borrowed past their statement (control, media), clippy's is_multiple_of, needless index loop and type complexity. input.rs: the MOUSE_MOVE_ABS builder dropped the y field; the PROTOCOL.md cross-check would have caught it at runtime.
This commit is contained in:
@@ -139,7 +139,7 @@ pub fn hex(s: &str) -> Vec<u8> {
|
||||
if s == "-" {
|
||||
return Vec::new();
|
||||
}
|
||||
assert!(s.len() % 2 == 0, "odd hex length");
|
||||
assert!(s.len().is_multiple_of(2), "odd hex length");
|
||||
(0..s.len()).step_by(2).map(|i| u8::from_str_radix(&s[i..i + 2], 16).expect("hex digit")).collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user