Skip to content

Commit

Permalink
chore: remove one unwrap (#12152)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 28, 2024
1 parent 05ee75f commit 367eb44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/net/ecies/src/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ impl ECIES {
out.extend_from_slice(tag.as_slice());
}

/// Extracts the header from slice and returns the body size.
pub fn read_header(&mut self, data: &mut [u8]) -> Result<usize, ECIESError> {
// If the data is not large enough to fit the header and mac bytes, return an error
//
Expand Down Expand Up @@ -677,7 +678,7 @@ impl ECIES {

self.body_size = Some(body_size);

Ok(self.body_size.unwrap())
Ok(body_size)
}

pub const fn header_len() -> usize {
Expand Down

0 comments on commit 367eb44

Please sign in to comment.