Skip to content

Commit

Permalink
Use unwrap over expect.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Durov committed Apr 20, 2024
1 parent e1be48c commit 0428dc1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ykrt/src/trace/swt/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ unsafe fn patch_function(function_ptr: usize, code: *const u8, size: size_t) {

// This unwrap should be safe since we are using a page that is
// based on function_ptr with a known location.
let layout = Layout::from_size_align(start_offset, page_size)
.expect("Failed to create layout for function memory page");
let layout = Layout::from_size_align(start_offset, page_size).unwrap();

// Set function memory page as writable.
// Ignoring mprotect call failure.
Expand Down

0 comments on commit 0428dc1

Please sign in to comment.