Skip to content

Commit 057d040

Browse files
committed
diode_send_file: Fix casting usize to u32 warning
1 parent 86cb3a4 commit 057d040

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

diode-file-bindings/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ pub unsafe extern "C" fn diode_send_file(
6464
let cstr_filepath = unsafe { CStr::from_ptr(ptr_filepath) };
6565
let rust_filepath = String::from_utf8_lossy(cstr_filepath.to_bytes()).to_string();
6666

67-
file::send::send_file(config, &rust_filepath).unwrap_or(0) as u32
67+
let result: usize = file::send::send_file(config, &rust_filepath).unwrap_or(0);
68+
u32::try_from(result).unwrap_or(0)
6869
}
6970

7071
/// # Panics

0 commit comments

Comments
 (0)