From 958ad3a9e78471a3ebb91ab6ef55ffa919ba64ce Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 5 Feb 2023 21:52:21 +0100 Subject: [PATCH] ffi.rs: silence warning about get_procs() We should fix this warning eventually. Silence it for now to make Clippy pass without warnings, which makes it much more useful. Compiling fish-rust v0.1.0 (/home/johannes/git/fish-riir/fish-rust) error: mutable borrow from immutable input(s) --> src/ffi.rs:79:32 | 79 | pub fn get_procs(&self) -> &mut [UniquePtr] { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: immutable borrow here --> src/ffi.rs:79:22 | 79 | pub fn get_procs(&self) -> &mut [UniquePtr] { | ^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_from_ref = note: `#[deny(clippy::mut_from_ref)]` on by default error: could not compile `fish-rust` due to previous error --- fish-rust/src/ffi.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/fish-rust/src/ffi.rs b/fish-rust/src/ffi.rs index bbc83c175..7ae4de648 100644 --- a/fish-rust/src/ffi.rs +++ b/fish-rust/src/ffi.rs @@ -66,6 +66,7 @@ impl parser_t { } impl job_t { + #[allow(clippy::mut_from_ref)] pub fn get_procs(&self) -> &mut [UniquePtr] { let ffi_procs = self.ffi_processes(); unsafe { slice::from_raw_parts_mut(ffi_procs.procs, ffi_procs.count) }