Pass slice to dc_receive_imf

instead of pointer and length
This commit is contained in:
Alexander Krotov
2019-09-27 17:53:35 +03:00
parent 6c9c21c135
commit 3933353b5f
3 changed files with 7 additions and 30 deletions

View File

@@ -96,16 +96,7 @@ pub unsafe fn dc_reset_tables(context: &Context, bits: i32) -> i32 {
fn dc_poke_eml_file(context: &Context, filename: impl AsRef<Path>) -> Result<(), Error> {
let data = dc_read_file(context, filename)?;
unsafe {
dc_receive_imf(
context,
data.as_ptr() as *const _,
data.len(),
"import",
0,
0,
)
};
unsafe { dc_receive_imf(context, &data, "import", 0, 0) };
Ok(())
}