diff --git a/justfile b/justfile index 3c8be29..f88bf78 100644 --- a/justfile +++ b/justfile @@ -27,3 +27,6 @@ alias cov:= coverage @format: cargo fmt + +@clippy: + cargo clippy -- -D warnings -A incomplete_features -W clippy::dbg_macro -W clippy::print_stdout \ No newline at end of file diff --git a/src/pkce/gen.rs b/src/pkce/gen.rs index bcfba20..5b28a27 100644 --- a/src/pkce/gen.rs +++ b/src/pkce/gen.rs @@ -10,16 +10,13 @@ use sha2::{Digest, Sha256}; ///
/// **PANICS !** if not between `43` & `128`. Defaults to `96` characters if no size is provided. pub fn gen_code_verifier(n: Option) -> String { - const DEFAULT_SIZE: usize = 96; + const DEFAULT_SIZE: usize = 96; const MIN_SIZE: usize = 43; - const MAX_SIZE: usize = 128; + const MAX_SIZE: usize = 128; let size: usize = n.unwrap_or(DEFAULT_SIZE); if !(MIN_SIZE..=MAX_SIZE).contains(&size) { - panic!( - "Invalid size, the size must be between {} and {}", - MIN_SIZE, MAX_SIZE - ); + panic!("Invalid size, the size must be between {} and {}", MIN_SIZE, MAX_SIZE); } urlsafe_token(size) } diff --git a/src/urlsafe/b64.rs b/src/urlsafe/b64.rs index cd0de08..f48d378 100644 --- a/src/urlsafe/b64.rs +++ b/src/urlsafe/b64.rs @@ -13,7 +13,7 @@ where type PlainText = Cow<'static, str>; -/// Decodes a URL-safe base64 encoded token +/// Decodes a URL-safe base64 encoded token pub fn urlsafe_b64decode(token: T) -> Result where T: AsRef<[u8]>,