Skip to content

Commit

Permalink
add clippy command to just
Browse files Browse the repository at this point in the history
  • Loading branch information
ashgw committed Apr 9, 2024
1 parent 4ee047e commit b75b087
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions src/pkce/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ use sha2::{Digest, Sha256};
/// <br>
/// **PANICS !** if not between `43` & `128`. Defaults to `96` characters if no size is provided.
pub fn gen_code_verifier(n: Option<usize>) -> 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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/urlsafe/b64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(token: T) -> Result<PlainText, B64Error>
where
T: AsRef<[u8]>,
Expand Down

0 comments on commit b75b087

Please sign in to comment.