Fix nightly clippy warnings

This commit is contained in:
link2xt
2022-12-26 00:01:58 +00:00
parent d73c4a92a7
commit 8de7014eeb
3 changed files with 3 additions and 2 deletions

View File

@@ -350,7 +350,7 @@ async fn decrypt_setup_file<T: std::io::Read + std::io::Seek>(
fn normalize_setup_code(s: &str) -> String {
let mut out = String::new();
for c in s.chars() {
if ('0'..='9').contains(&c) {
if c.is_ascii_digit() {
out.push(c);
if let 4 | 9 | 14 | 19 | 24 | 29 | 34 | 39 = out.len() {
out += "-"

View File

@@ -387,7 +387,7 @@ impl std::str::FromStr for Fingerprint {
let hex_repr: String = input
.to_uppercase()
.chars()
.filter(|&c| ('0'..='9').contains(&c) || ('A'..='F').contains(&c))
.filter(|&c| c.is_ascii_hexdigit())
.collect();
let v: Vec<u8> = hex::decode(&hex_repr)?;
ensure!(v.len() == 20, "wrong fingerprint length: {}", hex_repr);

View File

@@ -15,6 +15,7 @@
clippy::unused_async
)]
#![allow(
clippy::uninlined_format_args,
clippy::match_bool,
clippy::mixed_read_write_in_expression,
clippy::bool_assert_comparison,