chore: fix new clippy warnings (derive default)#18
Conversation
|
augment review |
1 similar comment
|
augment review |
🤖 Augment PR SummarySummary: This PR updates several enums across the codebase to satisfy new clippy warnings by switching from manual Changes:
Technical Notes: The intent appears to be behavior-preserving (defaults remain the same), while reducing duplicated boilerplate and addressing lint warnings. 🤖 Was this summary useful? React with 👍 or 👎 |
| tray_icon::MouseButtonState::Up => MouseButtonState::Up, | ||
| tray_icon::MouseButtonState::Down => MouseButtonState::Down, | ||
| tray_icon::MouseButtonState::Up => MouseButtonState::Down, | ||
| tray_icon::MouseButtonState::Down => MouseButtonState::Up, |
There was a problem hiding this comment.
The From<tray_icon::MouseButtonState> conversion now inverts Up/Down, which changes the meaning of button_state for all emitted tray click events and can break handlers that match on the previous values. If this wasn’t intentional, consider keeping a 1:1 mapping (or updating docs/examples/tests to reflect the new semantics).
🤖 Was this useful? React with 👍 or 👎
| match value { | ||
| tray_icon::MouseButtonState::Up => MouseButtonState::Up, | ||
| tray_icon::MouseButtonState::Down => MouseButtonState::Down, | ||
| tray_icon::MouseButtonState::Up => MouseButtonState::Down, |
There was a problem hiding this comment.
The From<tray_icon::MouseButtonState> mapping now inverts Up/Down (Up -> Down, Down -> Up), which looks like a behavioral change that could break click handling (e.g., examples match on MouseButtonState::Up). Was this inversion intentional, and if so is the public Up/Down semantics meant to differ from tray_icon?
🤖 Was this useful? React with 👍 or 👎
| TrayIconEvent::Click { | ||
| id, | ||
| position: PhysicalPosition { x: 0.0, y: 0.0 }, | ||
| rect: Rect { |
There was a problem hiding this comment.
TrayIconEvent::new_click constructs rect: Rect { position: PhysicalPosition {..}, size: PhysicalSize {..} }, but Rect elsewhere is populated via .into() from tray_icon::Rect (and uses Position/Size fields). This may yield an invalid/incorrect rect value (or at least an inconsistent representation) for serialization/consumers.
🤖 Was this useful? React with 👍 or 👎
Benchmark PR from qodo-benchmark#150