Open Bug 2094598 Opened 19 hours ago

Fix clippy warnings in intl/l10n/rust/localization-ffi

Categories

(Developer Infrastructure :: Lint and Formatting, task)

task

Tracking

(Not tracked)

People

(Reporter: Sylvestre, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=rust])

Filing as a good first bug to learn workflows.

The crate in intl/l10n/rust/localization-ffi triggers clippy warnings from the default lint set. Fix them all in a single patch; each one is a small, mechanical change and clippy's output suggests the fix.

Warnings and links to the code:
intl/l10n/rust/localization-ffi/src/lib.rs:198:33: this expression creates a reference which is immediately dereferenced by the compiler [clippy::needless_borrow]
https://searchfox.org/firefox-main/rev/cac2c0cf44beecb92c93119bd79e2408636f76d7/intl/l10n/rust/localization-ffi/src/lib.rs#198
intl/l10n/rust/localization-ffi/src/lib.rs:298:42: this expression creates a reference which is immediately dereferenced by the compiler [clippy::needless_borrow]
https://searchfox.org/firefox-main/rev/cac2c0cf44beecb92c93119bd79e2408636f76d7/intl/l10n/rust/localization-ffi/src/lib.rs#298
intl/l10n/rust/localization-ffi/src/lib.rs:324:19: casting to the same type is unnecessary (u32 -> u32) [clippy::unnecessary_cast]
https://searchfox.org/firefox-main/rev/cac2c0cf44beecb92c93119bd79e2408636f76d7/intl/l10n/rust/localization-ffi/src/lib.rs#324
intl/l10n/rust/localization-ffi/src/lib.rs:369:19: casting to the same type is unnecessary (u32 -> u32) [clippy::unnecessary_cast]
https://searchfox.org/firefox-main/rev/cac2c0cf44beecb92c93119bd79e2408636f76d7/intl/l10n/rust/localization-ffi/src/lib.rs#369
intl/l10n/rust/localization-ffi/src/lib.rs:423:19: casting to the same type is unnecessary (u32 -> u32) [clippy::unnecessary_cast]
https://searchfox.org/firefox-main/rev/cac2c0cf44beecb92c93119bd79e2408636f76d7/intl/l10n/rust/localization-ffi/src/lib.rs#423
intl/l10n/rust/localization-ffi/src/lib.rs:461:57: this expression creates a reference which is immediately dereferenced by the compiler [clippy::needless_borrow]
https://searchfox.org/firefox-main/rev/cac2c0cf44beecb92c93119bd79e2408636f76d7/intl/l10n/rust/localization-ffi/src/lib.rs#461

To verify the fix:

./mach lint -W -l clippy intl/l10n/rust/localization-ffi

The warnings above should no longer be reported, and the code should still build (./mach build).

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

You need to log in before you can comment on or make changes to this bug.