warning: unresolved link to `MiniScroll`
--> src/wizard.rs:108:5
|
108 | /// Use [MiniScroll] for [TabBar] to allow scrolling.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:
Use [MiniScroll] for [TabBar] to allow scrolling.
^^^^^^^^^^
= note: no item named `MiniScroll` in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
warning: unresolved link to `TabBar`
--> src/wizard.rs:108:5
|
108 | /// Use [MiniScroll] for [TabBar] to allow scrolling.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:
Use [MiniScroll] for [TabBar] to allow scrolling.
^^^^^^
= note: no item named `TabBar` in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: unclosed HTML tag `nodename`
--> src/tasks.rs:42:5
|
42 | /// The base url, default is '/nodes/<nodename>/tasks'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(rustdoc::invalid_html_tags)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
use and_then instead of map(..).flatten(..) on Option
Fixes:
warning: called `map(..).flatten()` on `Option`
--> src/configuration/network_view.rs:30:10
|
30 | .map(|c| c.as_str())
| __________^
31 | | .flatten()
| |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|c| c.as_str())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
use cloned() instead of explicit clone() in closure
Fixes:
warning: you are using an explicit closure for cloning elements
--> src/configuration/network_view.rs:91:31
|
91 | selected_record = self.store.read().lookup_record(key).map(|r| r.clone());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.store.read().lookup_record(key).cloned()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
= note: `#[warn(clippy::map_clone)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
use is_empty() instead of length comparison to zero
Fixes:
warning: length comparison to zero
--> src/rrd_graph_new.rs:660:22
|
660 | _ if data0.len() == 0 => {}
| ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `data0.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: the loop variable `i` is used to index `time_data`
--> src/rrd_graph_new.rs:388:14
|
388 | for i in 0..time_data.len() {
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
388 | for (i, <item>) in time_data.iter().enumerate() {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: this looks like you are swapping `start_x` and `end_x` manually
--> src/rrd_graph_new.rs:643:25
|
643 | / let t = start_x;
644 | | start_x = end_x;
645 | | end_x = t;
| |__________________________________^ help: try: `std::mem::swap(&mut start_x, &mut end_x);`
|
= note: or maybe you should use `std::mem::replace`?
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap
= note: `#[warn(clippy::manual_swap)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: redundant pattern matching, consider using `is_err()`
--> src/rrd_timeframe_selector.rs:116:20
|
116 | if let Err(_) = store.set_item("ProxmoxRRDTimeframe", &timeframe_str) {
| -------^^^^^^-------------------------------------------------------- help: try: `if store.set_item("ProxmoxRRDTimeframe", &timeframe_str).is_err()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: use of `or_insert` to construct default value
--> src/apt_repositories.rs:335:55
|
335 | let inner = info_map.entry(info.path.clone()).or_insert(HashMap::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
warning: use of `or_insert` to construct default value
--> src/apt_repositories.rs:336:45
|
336 | let entry = inner.entry(info.index).or_insert(Vec::new());
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: manual implementation of an assign operation
--> src/rrd_graph_new.rs:261:9
|
261 | l = l * 2;
| ^^^^^^^^^ help: replace it with: `l *= 2`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: called `is_none()` after searching an `Iterator` with `find`
--> src/apt_repositories.rs:282:8
|
282 | if list.iter().find(|l| l.status != Status::Ok).is_none() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!list.iter().any(|l| l.status != Status::Ok)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
= note: `#[warn(clippy::search_is_some)]` on by default
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
warning: casting to the same type is unnecessary (`f64` -> `f64`)
--> src/rrd_graph_new.rs:514:23
|
514 | + (((t - start_time) as f64 * width) as f64) / time_span
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((t - start_time) as f64 * width)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting float literal to `f64` is unnecessary
--> src/rrd_graph_new.rs:208:20
|
208 | while (range / (2.0 as f64).powi(l)) < 4.0 {
| ^^^^^^^^^^^^ help: try: `2.0_f64`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Dominik Csapak [Fri, 10 Jan 2025 10:21:37 +0000 (11:21 +0100)]
form: add helpers for property strings
when handling property strings in edit windows/input panels, we want to
have a consistent and easy way to handle them.
This introduces two helpers for parsing the property string into
separate parts (`flatten_property_string`) and one to generate the
property string again from parts (`property_string_from_parts`)
Shannon Sterz [Fri, 27 Dec 2024 13:44:17 +0000 (14:44 +0100)]
tfa add totp: ignore clippy lint ptr_args for validate
this is a private function for the validator, the signature needs to
match so we don't have to use a closure when using it. so ignore this
clippy lint here.
Shannon Sterz [Fri, 20 Dec 2024 14:50:54 +0000 (15:50 +0100)]
tree wide: implement `From` instead of `Into` where possible
as a `From` implementation gives you an `Into` implementation for free,
it should be preferred wherever possible. this fixes the
`from_over_into` clippy lint.
Shannon Sterz [Fri, 20 Dec 2024 14:38:57 +0000 (15:38 +0100)]
tree wide: implement `Default` for types with `fn new()`
this adds a `Default` implementation for all types that have a `new`
function that takes no parameters. this allows using in-build helpers
such as `unwrap_or_default` for these types and also removes the
`new_without_default` clippy lint [1].
Shannon Sterz [Fri, 20 Dec 2024 14:16:26 +0000 (15:16 +0100)]
acme: use `as_str` instead of re- and dereferencing
this check trips up clippy fixes, as `&*` should be redundant if both
sides try to take reference. however, due to how this type is
encapsulated, that won't work and break the check. so use `as_str` to
get a reference to a string slice for with comparison with `String` is
properly implemented.
Avoid panicking due to unconditionally access the data0 slice, rather
use get and see if we actually got data to work with, if not then
ignore it when the data slice is empty or log a debug message
otherwise, as that case shouldn't really happen.
The diff is consisting mostly of a indentation change, so best to
checkout with git's `-w` flag to ignore white space change.
This was reported in our community forum [0].
[0]: https://forum.proxmox.com/threads/159485/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>