diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2021-09-15 16:42:23 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2021-09-15 16:42:32 +0200 |
commit | fa4caed6d93e4addaf9396940288c83cac636aad (patch) | |
tree | be205ac90d0d383301190d360e27b46b36a94abd | |
parent | a5baec1a414a64ba8b03a924d2a15abadb41d2c8 (diff) |
openpgp-ffi: Avoid creating unused borrows.
-rw-r--r-- | openpgp-ffi/src/common.rs | 2 | ||||
-rw-r--r-- | openpgp-ffi/src/io.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/openpgp-ffi/src/common.rs b/openpgp-ffi/src/common.rs index 72b60298..afb299b9 100644 --- a/openpgp-ffi/src/common.rs +++ b/openpgp-ffi/src/common.rs @@ -97,7 +97,7 @@ pub(crate) fn strndup(src: &[u8]) -> Option<*mut libc::c_char> { let s = unsafe { ::std::slice::from_raw_parts_mut(libc::malloc(l) as *mut u8, l) }; - &mut s[..l - 1].copy_from_slice(src); + s[..l - 1].copy_from_slice(src); s[l - 1] = 0; Some(s.as_mut_ptr() as *mut libc::c_char) diff --git a/openpgp-ffi/src/io.rs b/openpgp-ffi/src/io.rs index d255e7ed..3760395f 100644 --- a/openpgp-ffi/src/io.rs +++ b/openpgp-ffi/src/io.rs @@ -443,7 +443,7 @@ impl Write for WriterAlloc { let sl = unsafe { slice::from_raw_parts_mut(*buffer.buf as *mut u8, *buffer.len) }; - &mut sl[old_len..].copy_from_slice(buf); + sl[old_len..].copy_from_slice(buf); Ok(buf.len()) } |