fix warnings
This commit is contained in:
parent
5ec4773eb1
commit
c6717e0e75
20 changed files with 87 additions and 147 deletions
math/str2int/src
|
@ -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("");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue