mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Fix nightly clippy warnings
This commit is contained in:
@@ -350,7 +350,7 @@ async fn decrypt_setup_file<T: std::io::Read + std::io::Seek>(
|
|||||||
fn normalize_setup_code(s: &str) -> String {
|
fn normalize_setup_code(s: &str) -> String {
|
||||||
let mut out = String::new();
|
let mut out = String::new();
|
||||||
for c in s.chars() {
|
for c in s.chars() {
|
||||||
if ('0'..='9').contains(&c) {
|
if c.is_ascii_digit() {
|
||||||
out.push(c);
|
out.push(c);
|
||||||
if let 4 | 9 | 14 | 19 | 24 | 29 | 34 | 39 = out.len() {
|
if let 4 | 9 | 14 | 19 | 24 | 29 | 34 | 39 = out.len() {
|
||||||
out += "-"
|
out += "-"
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ impl std::str::FromStr for Fingerprint {
|
|||||||
let hex_repr: String = input
|
let hex_repr: String = input
|
||||||
.to_uppercase()
|
.to_uppercase()
|
||||||
.chars()
|
.chars()
|
||||||
.filter(|&c| ('0'..='9').contains(&c) || ('A'..='F').contains(&c))
|
.filter(|&c| c.is_ascii_hexdigit())
|
||||||
.collect();
|
.collect();
|
||||||
let v: Vec<u8> = hex::decode(&hex_repr)?;
|
let v: Vec<u8> = hex::decode(&hex_repr)?;
|
||||||
ensure!(v.len() == 20, "wrong fingerprint length: {}", hex_repr);
|
ensure!(v.len() == 20, "wrong fingerprint length: {}", hex_repr);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
clippy::unused_async
|
clippy::unused_async
|
||||||
)]
|
)]
|
||||||
#![allow(
|
#![allow(
|
||||||
|
clippy::uninlined_format_args,
|
||||||
clippy::match_bool,
|
clippy::match_bool,
|
||||||
clippy::mixed_read_write_in_expression,
|
clippy::mixed_read_write_in_expression,
|
||||||
clippy::bool_assert_comparison,
|
clippy::bool_assert_comparison,
|
||||||
|
|||||||
Reference in New Issue
Block a user