From 69b48a1bedd12122c7bcf973288b136ff899a980 Mon Sep 17 00:00:00 2001 From: "Jonathan A. McCormick, Jr." <67705789+JonathanMcCormickJr@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:42:58 -0600 Subject: [PATCH] Adding Clippy fixes --- src/users.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/users.rs b/src/users.rs index 8cebab2..10acd9b 100644 --- a/src/users.rs +++ b/src/users.rs @@ -54,16 +54,16 @@ impl Password { if password.len() >= 16 { if password.chars().any(|c: char| c.is_uppercase()) && password.chars().any(|c: char| c.is_lowercase()) && - password.chars().any(|c: char| c.is_digit(10)) && + password.chars().any(|c: char| c.is_ascii_digit()) && password.chars().any(|c: char| !c.is_alphanumeric()) { - return Ok(Self { + Ok(Self { password: password.to_string(), - }); + }) } else { - return Err("Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character"); + Err("Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character") } } else { - return Err("Password must be at least 16 characters long") + Err("Password must be at least 16 characters long") } } }