refactor: resolve strict clippy diagnostics across lib and wayland modules - #38
Open
guylamar2006 wants to merge 1 commit into
Open
guylamar2006 wants to merge 1 commit into
guylamar2006 wants to merge 1 commit into
Conversation
…dules Fixes multiple strict lint warnings to align with a zero-warning profile: * clippy::non_std_lazy_statics: Replaces the explicit external `Lazy` type with standard `std::sync::LazyLock`. * clippy::as_conversions: Migrates primitive boolean casts (`is_press as i32`) to lossless `i32::from` conversions. * clippy::enum_glob_use: Replaces the `MouseButtons::*` glob pattern with explicit variant imports in `TryFrom`. * clippy::explicit_iter_loop: Changes `.iter()` calls on structural collections to standard implicit reference loops (`&data.wl_outputs`). * clippy::ignored_unit_patterns: Updates the `_` unit type discards to explicit `()` matching. * clippy::type_complexity: Standardizes trait `QueueHandle<OutputData>` bounds using the `Self` alias context. fix return statements
guylamar2006
force-pushed
the
clippy-fixes
branch
from
September 12, 2026 17:16
b4ba206 to
cdecc54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request primarily refactors code in
src/lib.rsandsrc/wayland.rsto improve code style, update usage of synchronization primitives, and clarify type conversions. The main changes include replacingonce_cell::sync::Lazywithstd::sync::LazyLock, simplifying type conversions, and making minor improvements to iterator and trait usage.Refactoring and Modernization:
once_cell::sync::Lazywithstd::sync::LazyLockfor the staticDEVICEinitialization insrc/lib.rs, aligning with modern Rust standard library features.i32::from(is_press)instead ofis_press as i32, making the conversion explicit and idiomatic. [1] [2] [3] [4]Code Style and Clarity:
for output in data.wl_outputs.iter()tofor output in &data.wl_outputsinsrc/wayland.rsfor improved clarity and idiomatic iteration.Dispatch, clarified parameter usage and type annotations for better readability and maintainability. [1] [2]use MouseButtons::*import more explicit by listing individual variants, improving code clarity.