Skip to content

Commit 790c344

Browse files
authored
refactor: replace unwrap with expect in _macros.rs (#341)
1 parent dccfdf9 commit 790c344

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ macro_rules! panic_on_tskit_error {
2020
($code: expr) => {
2121
if $code < 0 {
2222
let c_str = unsafe { std::ffi::CStr::from_ptr($crate::bindings::tsk_strerror($code)) };
23-
let str_slice: &str = c_str.to_str().unwrap();
23+
let str_slice: &str = c_str.to_str().expect("failed to obtain &str from c_str");
2424
let message: String = str_slice.to_owned();
2525
panic!("{}", message);
2626
}

0 commit comments

Comments
 (0)