Update cosmic_applet_power.ftl PL translation #912
Annotations
10 warnings
taken reference of right operand:
cosmic-app-list/cosmic-app-list-config/src/lib.rs#L45
warning: taken reference of right operand
--> cosmic-app-list/cosmic-app-list-config/src/lib.rs:45:63
|
45 | if let Some(pos) = self.favorites.iter().position(|e| e == &id) {
| ^^^^^---
| |
| help: use the right value directly: `id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref
= note: `#[warn(clippy::op_ref)]` on by default
|
this `if` statement can be collapsed:
cosmic-applet-audio/src/mouse_area.rs#L301
warning: this `if` statement can be collapsed
--> cosmic-applet-audio/src/mouse_area.rs:301:9
|
301 | / if !state.is_out_of_bounds {
302 | | if widget
303 | | .on_mouse_enter
304 | | .as_ref()
... |
315 | | }
316 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
301 ~ if !state.is_out_of_bounds && widget
302 + .on_mouse_enter
303 + .as_ref()
304 + .or(widget.on_mouse_exit.as_ref())
305 + .is_some() {
306 + if let Event::Mouse(mouse::Event::CursorMoved { .. }) = event {
307 + state.is_out_of_bounds = true;
308 + if let Some(message) = widget.on_mouse_exit.as_ref() {
309 + shell.publish(message.clone());
310 + }
311 + return event::Status::Captured;
312 + }
313 + }
|
|
unused imports: `Rectangle`, `protocols::xdg::shell::client::xdg_positioner::Anchor`:
cosmic-applet-audio/src/lib.rs#L16
warning: unused imports: `Rectangle`, `protocols::xdg::shell::client::xdg_positioner::Anchor`
--> cosmic-applet-audio/src/lib.rs:16:38
|
16 | cctk::sctk::reexports::{calloop, protocols::xdg::shell::client::xdg_positioner::Anchor},
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
21 | window, Alignment, Length, Limits, Rectangle, Subscription,
| ^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
using `.iter().next()` on an array:
cosmic-applet-audio/src/mouse_area.rs#L268
warning: using `.iter().next()` on an array
--> cosmic-applet-audio/src/mouse_area.rs:268:30
|
268 | if let Some(state) = state.children.iter().next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling: `state.children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice
= note: `#[warn(clippy::iter_next_slice)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
cosmic-applet-audio/src/mpris_subscription.rs#L159
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> cosmic-applet-audio/src/mpris_subscription.rs:159:45
|
159 | players.sort_by(|a, b| a.name().cmp(&b.name()));
| ^^^^^^^^^ help: change this to: `b.name()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
cosmic-applet-audio/src/mpris_subscription.rs#L183
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> cosmic-applet-audio/src/mpris_subscription.rs:183:50
|
183 | self.players.sort_by(|a, b| a.name().cmp(&b.name()));
| ^^^^^^^^^ help: change this to: `b.name()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the following explicit lifetimes could be elided: 'a:
cosmic-applet-audio/src/mpris_subscription.rs#L274
warning: the following explicit lifetimes could be elided: 'a
--> cosmic-applet-audio/src/mpris_subscription.rs:274:22
|
274 | async fn find_active<'a>(players: &'a Vec<MprisPlayer>) -> Option<&'a MprisPlayer> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
cosmic-applet-audio/src/mpris_subscription.rs#L274
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> cosmic-applet-audio/src/mpris_subscription.rs:274:35
|
274 | async fn find_active<'a>(players: &'a Vec<MprisPlayer>) -> Option<&'a MprisPlayer> {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `&'a [MprisPlayer]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
cosmic-applet-audio/src/pulse.rs#L28
warning: very complex type used. Consider factoring parts into `type` definitions
--> cosmic-applet-audio/src/pulse.rs:28:24
|
28 | pub static FROM_PULSE: Lazy<Mutex<Option<(mpsc::Receiver<Message>, mpsc::Sender<Message>)>>> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
variant `OpenSettings` is never constructed:
cosmic-applet-notifications/src/lib.rs#L96
warning: variant `OpenSettings` is never constructed
--> cosmic-applet-notifications/src/lib.rs:96:5
|
84 | enum Message {
| ------- variant in this enum
...
96 | OpenSettings,
| ^^^^^^^^^^^^
|
= note: `Message` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|