fix warnings

This commit is contained in:
Michael Sippel 2021-05-13 16:22:30 +02:00
parent 5ec4773eb1
commit c6717e0e75
Signed by: senvas
GPG key ID: F96CF119C34B64A6
20 changed files with 87 additions and 147 deletions
math/str2int/src

View file

@ -46,15 +46,15 @@ $1: radix
args.next().expect("Arg $0 missing!");
let radix_str = args.next().expect("Arg $1 required!");
let radix = u32::from_str_radix(&radix_str, 10).expect("could not parse radix");
if radix > 16 {
panic!("invalid radix! (radix<=16 required)");
}
let mut chars = Vec::new();
f0.read_to_end(&mut chars);
f0.read_to_end(&mut chars).expect("");
chars.retain(|c| (*c as char).is_alphanumeric());
f1.write(&u64::from_str_radix(&String::from_utf8_lossy(&chars), radix).unwrap().to_le_bytes());
f1.write(&u64::from_str_radix(&String::from_utf8_lossy(&chars), radix).unwrap().to_le_bytes()).expect("");
}