Skip to content

Commit

Permalink
rust: remove unnecessary unwraps
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw committed Oct 1, 2024
1 parent 14e1c5b commit 5874af1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl TimeStampReq {
contents: OwnedMessageImprint::try_new(self.raw.borrow_owner().clone_ref(py), |v| {
RawMessageImprint::parse_data(v.as_bytes(py))
})
.unwrap(),
.map_err(|_| PyValueError::new_err("invalid message imprint"))?,
})
}

Expand Down Expand Up @@ -342,7 +342,7 @@ impl PyTSTInfo {
self.raw.borrow_owner().clone().borrow_owner().clone_ref(py),
|v| RawMessageImprint::parse_data(v.as_bytes(py)),
)
.unwrap(),
.map_err(|_| PyValueError::new_err("invalid message imprint"))?,
})
}

Expand Down

0 comments on commit 5874af1

Please sign in to comment.