fix: clippy warnings

This commit is contained in:
Kristofers Solo 2025-11-26 06:42:29 +02:00
parent b81b87e6db
commit f1a0ab75c3
Signed by: kristoferssolo
GPG Key ID: 8687F2D3EEE6F0ED
4 changed files with 10 additions and 5 deletions

View File

@ -24,7 +24,7 @@ zeroize = { version = "1.8", features = ["derive"] }
[workspace.lints.clippy] [workspace.lints.clippy]
nursery = "warn" nursery = "warn"
pedantic = "warn" pedantic = "warn"
unwarp_used = "warn" unwrap_used = "warn"
# Defines a size-optimized profile for the WASM bundle in release mode # Defines a size-optimized profile for the WASM bundle in release mode
[profile.wasm-release] [profile.wasm-release]

View File

@ -107,7 +107,7 @@ impl<'a> Iterator for SubkeyChunks<'a> {
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
self.0 self.0
.next() .next()
.map(|chunk| <&[Subkey; 4]>::try_from(chunk).unwrap()) .map(|chunk| <&[Subkey; 4]>::try_from(chunk).expect("4 chunk subkeys"))
} }
} }
@ -118,7 +118,7 @@ impl<'a> Iterator for SubkeyChunksRev<'a> {
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
self.0 self.0
.next() .next()
.map(|chunk| <&[Subkey; 4]>::try_from(chunk).unwrap()) .map(|chunk| <&[Subkey; 4]>::try_from(chunk).expect("4 chunk subkeys"))
} }
} }

View File

@ -29,6 +29,10 @@ impl CipherContext {
} }
} }
/// # Errors
///
/// Returns `Err` if parsing the input text or creating the cipher fails,
/// or if the encryption/decryption process encounters an error.
pub fn process(&self) -> CipherResult<String> { pub fn process(&self) -> CipherResult<String> {
let text_bytes = self.algorithm.parse_text(&self.input_text)?; let text_bytes = self.algorithm.parse_text(&self.input_text)?;
let cipher = self.algorithm.new_cipher(&self.key)?; let cipher = self.algorithm.new_cipher(&self.key)?;

View File

@ -34,8 +34,9 @@ ssr = [
"leptos_router/ssr", "leptos_router/ssr",
] ]
[lints] [lints.clippy]
workspace = true nursery = "warn"
unwrap_used = "warn"
# Defines a size-optimized profile for the WASM bundle in release mode # Defines a size-optimized profile for the WASM bundle in release mode
[profile.wasm-release] [profile.wasm-release]