There was an error while loading. Please reload this page.
1 parent 86cb3a4 commit 057d040Copy full SHA for 057d040
1 file changed
diode-file-bindings/src/lib.rs
@@ -64,7 +64,8 @@ pub unsafe extern "C" fn diode_send_file(
64
let cstr_filepath = unsafe { CStr::from_ptr(ptr_filepath) };
65
let rust_filepath = String::from_utf8_lossy(cstr_filepath.to_bytes()).to_string();
66
67
- file::send::send_file(config, &rust_filepath).unwrap_or(0) as u32
+ let result: usize = file::send::send_file(config, &rust_filepath).unwrap_or(0);
68
+ u32::try_from(result).unwrap_or(0)
69
}
70
71
/// # Panics
0 commit comments