Skip to content

Commit

Permalink
style: Use inner function
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Jul 27, 2024
1 parent bbfc5cc commit 6dd9675
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/scryptenc/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ impl Params {
/// assert!(Params::new(ciphertext).is_ok());
/// ```
pub fn new(ciphertext: impl AsRef<[u8]>) -> Result<Self> {
let params = Header::parse(ciphertext.as_ref()).map(|h| h.params())?;
Ok(params)
let inner = |ciphertext: &[u8]| -> Result<Self> {
let params = Header::parse(ciphertext).map(|h| h.params())?;
Ok(params)
};
inner(ciphertext.as_ref())
}

/// Gets log₂ of the scrypt parameter `N`.
Expand Down

0 comments on commit 6dd9675

Please sign in to comment.