needless-pass-by-value Disallow passing parameters by value when they are never consumed or mutated Taking ownership of a move-only parameter prevents callers from retaining it when the body only reads the value. Instead, you SHOULD accept a readonly borrow when the function neither mutates nor consumes the parameter. Keep ownership when transferring the value is part of the callable's behavior. - Category: performance - Level: warning - Fix: none - Scope: module Reported struct Packet { code: int32; } function packetCode(packet: Packet): int32 { return packet.code; } Accepted struct Packet { code: int32; } function packetCode(packet: &readonly Packet): int32 { return packet.code; } Prior art - Clippy ยท needlesspassbyvalue language/linter/src/rules/performance/needlesspassbyvalue.rs:9