[PATCH char-misc-next] rust_binder: fix needless borrow in context.rs

Shivam Kalra posted 1 patch 1 week, 1 day ago
drivers/android/binder/context.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH char-misc-next] rust_binder: fix needless borrow in context.rs
Posted by Shivam Kalra 1 week, 1 day ago
Clippy warns about a needless borrow in context.rs:

    error: this expression creates a reference which is immediately dereferenced by the compiler
       --> drivers/android/binder/context.rs:141:18
        |
    141 |             func(&proc);
        |                  ^^^^^ help: change this to: `proc`

Remove the unnecessary borrow to satisfy clippy and improve code
cleanliness. No functional change.

Signed-off-by: Shivam Kalra <shivamklr@cock.li>
---
 drivers/android/binder/context.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder/context.rs b/drivers/android/binder/context.rs
index c7b75efef217f..9cf437c025a20 100644
--- a/drivers/android/binder/context.rs
+++ b/drivers/android/binder/context.rs
@@ -138,7 +138,7 @@ pub(crate) fn for_each_proc<F>(&self, mut func: F)
     {
         let lock = self.manager.lock();
         for proc in &lock.all_procs {
-            func(&proc);
+            func(proc);
         }
     }
 

base-commit: 96657eb5ab7e231f6333a3fbc674c0451f13f7f1
-- 
2.43.0
Re: [PATCH char-misc-next] rust_binder: fix needless borrow in context.rs
Posted by Alice Ryhl 1 week, 1 day ago
On Fri, Jan 30, 2026 at 7:31 PM Shivam Kalra <shivamklr@cock.li> wrote:
>
> Clippy warns about a needless borrow in context.rs:
>
>     error: this expression creates a reference which is immediately dereferenced by the compiler
>        --> drivers/android/binder/context.rs:141:18
>         |
>     141 |             func(&proc);
>         |                  ^^^^^ help: change this to: `proc`
>
> Remove the unnecessary borrow to satisfy clippy and improve code
> cleanliness. No functional change.
>
> Signed-off-by: Shivam Kalra <shivamklr@cock.li>

Thanks.
Acked-by: Alice Ryhl <aliceryhl@google.com>