Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: replace unwrap with expect in _macros.rs
  • Loading branch information
molpopgen committed Oct 28, 2022
commit 688e135f41587eb7edadea7e7380d25c485e56ec
2 changes: 1 addition & 1 deletion src/_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ macro_rules! panic_on_tskit_error {
($code: expr) => {
if $code < 0 {
let c_str = unsafe { std::ffi::CStr::from_ptr($crate::bindings::tsk_strerror($code)) };
let str_slice: &str = c_str.to_str().unwrap();
let str_slice: &str = c_str.to_str().expect("failed to obtain &str from c_str");
let message: String = str_slice.to_owned();
panic!("{}", message);
}
Expand Down