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<process_t>] {
       |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
    note: immutable borrow here
      --> src/ffi.rs:79:22
       |
    79 |     pub fn get_procs(&self) -> &mut [UniquePtr<process_t>] {
       |                      ^^^^^
       = 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
This commit is contained in:
Johannes Altmanninger 2023-02-05 21:52:21 +01:00
parent 29a2c4b718
commit 958ad3a9e7

View file

@ -66,6 +66,7 @@ impl parser_t {
}
impl job_t {
#[allow(clippy::mut_from_ref)]
pub fn get_procs(&self) -> &mut [UniquePtr<process_t>] {
let ffi_procs = self.ffi_processes();
unsafe { slice::from_raw_parts_mut(ffi_procs.procs, ffi_procs.count) }