Skip to content

chore(deps): bump syn from 2.0.63 to 2.0.66 #124

chore(deps): bump syn from 2.0.63 to 2.0.66

chore(deps): bump syn from 2.0.63 to 2.0.66 #124

GitHub Actions / clippy succeeded May 27, 2024 in 0s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (0)
Filtered Findings (111)

goldboot-image/src/lib.rs|473 col 33| warning: unneeded unit return type
--> goldboot-image/src/lib.rs:473:33
|
473 | pub fn write<F: Fn(u64, u64) -> ()>(&self, dest: impl AsRef, progress: F) -> Result<()> {
| ^^^^^^ help: remove the -> ()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
= note: #[warn(clippy::unused_unit)] on by default
goldboot-image/src/lib.rs|577 col 35| warning: unneeded unit return type
--> goldboot-image/src/lib.rs:577:35
|
577 | progress: Box<dyn Fn(u64, u64) -> ()>,
| ^^^^^^ help: remove the -> ()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
goldboot-image/src/qcow/levels.rs|96 col 25| warning: unused variable: r
--> goldboot-image/src/qcow/levels.rs:96:25
|
96 | let r = reader.take(cluster_size).read_to_end(&mut buf)?;
| ^ help: if this is intentional, prefix it with an underscore: _r
|
= note: #[warn(unused_variables)] on by default
goldboot-image/src/lib.rs|1 col 1| warning: empty doc comment
--> goldboot-image/src/lib.rs:1:1
|
1 | //!
| ^^^
|
= help: consider removing or filling it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
= note: #[warn(clippy::empty_docs)] on by default
goldboot-image/src/qcow/mod.rs|62 col 17| warning: unnecessary use of to_string
--> goldboot-image/src/qcow/mod.rs:62:17
|
62 | &path.to_string_lossy().to_string(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: path.to_string_lossy().as_ref()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: #[warn(clippy::unnecessary_to_owned)] on by default
goldboot-image/src/lib.rs|209 col 9| warning: unneeded return statement
--> goldboot-image/src/lib.rs:209:9
|
209 | return self.public == 1u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: #[warn(clippy::needless_return)] on by default
help: remove return
|
209 - return self.public == 1u8;
209 + self.public == 1u8
|
goldboot-image/src/lib.rs|416 col 28| warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:416:28
|
416 | compute_id(&path).unwrap()
| ^^^^^ help: change this to: path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: #[warn(clippy::needless_borrows_for_generic_args)] on by default
goldboot-image/src/lib.rs|419 col 24| warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:419:24
|
419 | compute_id(&path).unwrap()
| ^^^^^ help: change this to: path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
goldboot-image/src/lib.rs|443 col 46| warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:443:46
|
443 | file_size: std::fs::metadata(&path)?.len(),
| ^^^^^ help: change this to: path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
goldboot-image/src/lib.rs|454 col 46| warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:454:46
|
454 | file_size: std::fs::metadata(&path)?.len(),
| ^^^^^ help: change this to: path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
goldboot-image/src/lib.rs|488 col 14| warning: file opened with create, but truncate behavior not defined
--> goldboot-image/src/lib.rs:488:14
|
488 | .create(true)
| ^^^^^^^^^^^^- help: add: .truncate(true)
|
= help: if you intend to overwrite an existing file entirely, call .truncate(true)
= help: if you instead know that you may want to keep some parts of the old file, call .truncate(false)
= help: alternatively, use .append(true) to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
= note: #[warn(clippy::suspicious_open_options)] on by default
goldboot-image/src/lib.rs|506 col 18| warning: the loop variable i is used to index digest_table
--> goldboot-image/src/lib.rs:506:18
|
506 | for i in 0..protected_header.cluster_count as usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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()
|
506 | for (i, ) in digest_table.iter().enumerate().take(protected_header.cluster_count as usize) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
goldboot-image/src/lib.rs|617 col 21| warning: the following explicit lifetimes could be elided: 'a
--> goldboot-image/src/lib.rs:617:21
|
617 | pub fn progress<'a, F>(&'a mut self, progress: F) -> &'a mut Self
| ^^ ^^ ^^
|
= 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
help: elide the lifetimes
|
617 - pub fn progress<'a, F>(&'a mut self, progress: F) -> &'a mut Self
617 + pub fn progress(&mut self, progress: F) -> &mut Self
|
goldboot-image/src/lib.rs|670 col 65| warning: redundant slicing of the whole range
--> goldboot-image/src/lib.rs:670:65
|
670 | primary_header.name[0..self.name.len()].copy_from_slice(&self.name.clone().as_bytes()[..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the original value instead: self.name.clone().as_bytes()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing
= note: #[warn(clippy::redundant_slicing)] on by default
goldboot-macros/src/lib.rs|3 col 17| warning: unused import: DataStruct
--> goldboot-macros/src/lib.rs:3:17
|
3 | use syn::{self, DataStruct};
| ^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
goldboot-macros/src/lib.rs|14 col 9| warning: unused variable: fields
--> goldboot-macros/src/lib.rs:14:9
|
14 | let fields: Vec = match &ast.data {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: _fields
|
= note: #[warn(unused_variables)] on by default
goldboot-macros/src/lib.rs|3 col 17| warning: unused import: DataStruct
--> goldboot-macros/src/lib.rs:3:17
|
3 | use syn::{self, DataStruct};
| ^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
goldboot-macros/src/lib.rs|14 col 9| warning: unused variable: fields
--> goldboot-macros/src/lib.rs:14:9
|
14 | let fields: Vec = match &ast.data {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: _fields
|
= note: #[warn(unused_variables)] on by default
goldboot/src/cli/cmd/deploy.rs|36 col 13| warning: this if statement can be collapsed
--> goldboot/src/cli/cmd/deploy.rs:36:13
|
36 | / if Path::new(&output).exists() && !confirm {
37 | | if !Confirm::with_theme(&theme)
38 | | .with_prompt("Do you want to continue?")
39 | | .interact()
... |
43 | | }
44 | | }
| |^
|
= 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
|
36 ~ if Path::new(&output).exists() && !confirm && !Confirm::with_theme(&theme)
37 + .with_prompt("Do you want to continue?")
38 + .interact()
39 + .unwrap() {
40 + std::process::exit(0);
41 + }
|
goldboot/src/cli/cmd/liveusb.rs|3 col 5| warning: unused import: goldboot_image::ImageHandle
--> goldboot/src/cli/cmd/liveusb.rs:3:5
|
3 | use goldboot_image::ImageHandle;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
goldboot/src/cli/cmd/liveusb.rs|36 col 13| warning: this if statement can be collapsed
--> goldboot/src/cli/cmd/liveusb.rs:36:13
|
36 | / if !confirm {
37 | | if !Confirm::with_theme(&theme)
38 | | .with_prompt(format!("Do you want to overwrite: {}?", dest))
39 | | .interact()
... |
43 | | }
44 | | }
| |
^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
36 ~ if !confirm && !Confirm::with_theme(&theme)
37 + .with_prompt(format!("Do you want to overwrite: {}?", dest))
38 + .interact()
39 + .unwrap() {
40 + return ExitCode::FAILURE;
41 + }
|
goldboot/src/foundry/mod.rs|4 col 13| warning: unused import: cli::progress::ProgressBar
--> goldboot/src/foundry/mod.rs:4:13
|
4 | use crate::{cli::progress::ProgressBar, library::ImageLibrary};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
goldboot/src/foundry/mod.rs|10 col 46| warning: unused import: ImageHandle
--> goldboot/src/foundry/mod.rs:10:46
|
10 | use goldboot_image::{qcow::Qcow3, ImageArch, ImageHandle};
| ^^^^^^^^^^^
goldboot/src/foundry/fabricators/ansible.rs|67 col 9| warning: this if statement can be collapsed
--> goldboot/src/foundry/fabricators/ansible.rs:67:9
|
67 | / if !Path::new(&self.playbook).exists() {
68 | | if !dialoguer::Confirm::with_theme(&*theme)
69 | | .with_prompt("The path does not exist. Add anyway?")
70 | | .interact()?
... |
73 | | }
74 | | }
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
67 ~ if !Path::new(&self.playbook).exists() && !dialoguer::Confirm::with_theme(&*theme)
68 + .with_prompt("The path does not exist. Add anyway?")
69 + .interact()? {
70 + bail!("The playbook did not exist");
71 + }
|
goldboot/src/foundry/fabricators/exe.rs|36 col 9| warning: this if statement can be collapsed
--> goldboot/src/foundry/fabricators/exe.rs:36:9
|
36 | / if !Path::new(&self.path).exists() {
37 | | if !dialoguer::Confirm::with_theme(&*theme)
38 | | .with_prompt("The path does not exist. Add anyway?")
39 | | .interact()?
... |
42 | | }
43 | | }
| |
^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
36 ~ if !Path::new(&self.path).exists() && !dialoguer::Confirm::with_theme(&*theme)
37 + .with_prompt("The path does not exist. Add anyway?")
38 + .interact()? {
39 + bail!("The playbook did not exist");
40 + }
|
goldboot/src/foundry/http.rs|3 col 11| warning: unused import: collections::HashMap
--> goldboot/src/foundry/http.rs:3:11
|
3 | use std::{collections::HashMap, path::Path};
| ^^^^^^^^^^^^^^^^^^^^
goldboot/src/foundry/http.rs|7 col 16| warning: unused import: ServeDir
--> goldboot/src/foundry/http.rs:7:16
|
7 | services::{ServeDir, ServeFile},
| ^^^^^^^^
goldboot/src/foundry/molds/arch_linux/archinstall.rs|6 col 5| warning: unused import: crate::foundry::options::hostname::Hostname
--> goldboot/src/foundry/molds/arch_linux/archinstall.rs:6:5
|
6 | use crate::foundry::options::hostname::Hostname;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
goldboot/src/foundry/molds/debian/mod.rs|18 col 12| warning: unused import: wait
--> goldboot/src/foundry/molds/debian/mod.rs:18:12
|
18 | input, wait, wait_screen, wait_screen_rect,
| ^^^^
goldboot/src/foundry/molds/goldboot/mod.rs|8 col 19| warning: unused import: BufReader
--> goldboot/src/foundry/molds/goldboot/mod.rs:8:19
|
8 | io::{BufRead, BufReader},
| ^^^^^^^^^
goldboot/src/foundry/molds/goldboot/mod.rs|18 col 19| warning: unused imports: hostname::Hostname, unix_account::RootPassword, wait
--> goldboot/src/foundry/molds/goldboot/mod.rs:18:19
|
18 | options::{hostname::Hostname, unix_account::RootPassword},
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
...
23 | input, wait, wait_screen, wait_screen_rect,
| ^^^^
goldboot/src/foundry/molds/nix/mod.rs|5 col 33| warning: unused import: fmt::Display
--> goldboot/src/foundry/molds/nix/mod.rs:5:33
|
5 | use std::{collections::HashMap, fmt::Display};
| ^^^^^^^^^^^^
goldboot/src/foundry/molds/nix/mod.rs|6 col 13| warning: unused imports: Display, EnumIter, IntoEnumIterator
--> goldboot/src/foundry/molds/nix/mod.rs:6:13
|
6 | use strum::{Display, EnumIter, IntoEnumIterator};
| ^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^
goldboot/src/foundry/molds/nix/mod.rs|10 col 27| warning: unused imports: PromptNew, hostname::Hostname, unix_account::RootPassword
--> goldboot/src/foundry/molds/nix/mod.rs:10:27
|
10 | cli::prompt::{Prompt, PromptNew},
| ^^^^^^^^^
...
13 | options::{hostname::Hostname, unix_account::RootPassword},
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
goldboot/src/foundry/qemu.rs|8 col 15| warning: unused import: File
--> goldboot/src/foundry/qemu.rs:8:15
|
8 | use std::fs::{File, OpenOptions};
| ^^^^
goldboot/src/foundry/qemu.rs|9 col 15| warning: unused import: Cursor
--> goldboot/src/foundry/qemu.rs:9:15
|
9 | use std::io::{Cursor, Write};
| ^^^^^^
goldboot/src/foundry/sources/mod.rs|73 col 13| warning: this if statement can be collapsed
--> goldboot/src/foundry/sources/mod.rs:73:13
|
73 | / if path.is_file() {
74 | | if !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
75 | | .is_ok()
76 | | {
... |
79 | | }
80 | | }
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
73 ~ if path.is_file() && !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
74 + .is_ok() {
75 + info!("Deleting corrupt cached file");
76 + std::fs::remove_file(&path)?;
77 + }
|
goldboot/src/foundry/ssh.rs|11 col 5| warning: unused import: std::thread::sleep
--> goldboot/src/foundry/ssh.rs:11:5
|
11 | use std::thread::sleep;
| ^^^^^^^^^^^^^^^^^^
goldboot/src/foundry/vnc.rs|410 col 17| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:410:17
|
410 | crate::foundry::vnc::VncCmd::Type($text.to_string()),
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
= note: #[warn(clippy::crate_in_macro_def)] on by default
goldboot/src/foundry/vnc.rs|427 col 17| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:427:17
|
427 | crate::foundry::vnc::VncCmd::Spacebar,
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|437 col 17| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:437:17
|
437 | crate::foundry::vnc::VncCmd::Escape,
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|447 col 17| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:447:17
|
447 | crate::foundry::vnc::VncCmd::Type($text.to_string()),
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|463 col 18| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:463:18
|
463 | vec![crate::foundry::vnc::VncCmd::Wait($duration)]
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|470 col 18| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:470:18
|
470 | vec![crate::foundry::vnc::VncCmd::WaitScreen($hash.to_string())]
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|477 col 18| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:477:18
|
477 | vec![crate::foundry::vnc::VncCmd::WaitScreenRect(
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|491 col 17| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:491:17
|
491 | crate::foundry::vnc::VncCmd::Type($text.to_string()),
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/foundry/vnc.rs|501 col 17| warning: crate references the macro call's crate
--> goldboot/src/foundry/vnc.rs:501:17
|
501 | crate::foundry::vnc::VncCmd::LeftSuper,
| ^^^^^ help: to reference the macro definition's crate, use: $crate
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
goldboot/src/library.rs|13 col 15| warning: unused imports: debug, error
--> goldboot/src/library.rs:13:15
|
13 | use tracing::{debug, error, info};
| ^^^^^ ^^^^^
goldboot/src/cli/cmd/image.rs|21 col 30| warning: use of deprecated method chrono::TimeZone::timestamp: use timestamp_opt() instead
--> goldboot/src/cli/cmd/image.rs:21:30
|
21 | ... .timestamp(image.primary_header.timestamp as i64, 0)
| ^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
goldboot/src/foundry/molds/goldboot/mod.rs|8 col 10| warning: unused import: BufRead
--> goldboot/src/foundry/molds/goldboot/mod.rs:8:10
|
8 | io::{BufRead, BufReader},
| ^^^^^^^
goldboot/src/cli/cmd/liveusb.rs|13 col 13| warning: unused variable: include
--> goldboot/src/cli/cmd/liveusb.rs:13:13
|
13 | include,
| ^^^^^^^ help: try ignoring the field: include: _
|
= note: #[warn(unused_variables)] on by default
goldboot/src/foundry/molds/alpine_linux/mod.rs|92 col 13| warning: variable does not need to be mutable
--> goldboot/src/foundry/molds/alpine_linux/mod.rs:92:13
|
92 | let mut ssh = qemu.ssh("root")?;
| ----^^^
| |
| help: remove this mut
|
= note: #[warn(unused_mut)] on by default
goldboot/src/foundry/molds/alpine_linux/mod.rs|115 col 9| warning: unused variable: foundry
--> goldboot/src/foundry/molds/alpine_linux/mod.rs:115:9
|
115 | foundry: &crate::foundry::Foundry,
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: _foundry
goldboot/src/foundry/molds/debian/mod.rs|140 col 13| warning: variable does not need to be mutable
--> goldboot/src/foundry/molds/debian/mod.rs:140:13
|
140 | let mut ssh = qemu.ssh("root")?;
| ----^^^
| |
| help: remove this mut
goldboot/src/foundry/ssh.rs|235 col 13| warning: unused variable: session
--> goldboot/src/foundry/ssh.rs:235:13
|
235 | fn query_os(session: &ssh2::Session) -> Result {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: _session
goldboot/src/cli/cmd/image.rs|24 col 25| warning: literal with an empty format string
--> goldboot/src/cli/cmd/image.rs:24:25
|
24 | "TODO",
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal
= note: #[warn(clippy::print_literal)] on by default
help: try
|
17 ~ "{:15} {:12} {:31} {:12} TODO",
18 | std::str::from_utf8(&image.primary_header.name).unwrap(),
...
22 | .to_rfc2822(),
23 ~ &image.id[0..12],
|
goldboot/src/cli/cmd/init.rs|19 col 24| warning: literal with an empty format string
--> goldboot/src/cli/cmd/init.rs:19:24
|
19 | println!("{}", "");
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal
help: try
|
19 - println!("{}", "");
19 + println!("");
|
goldboot/src/cli/cmd/init.rs|23 col 24| warning: literal with an empty format string
--> goldboot/src/cli/cmd/init.rs:23:24
|
23 | println!("{}", "");
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal
help: try
|
23 - println!("{}", "");
23 + println!("");
|
goldboot/src/cli/cmd/init.rs|46 col 16| warning: length comparison to zero
--> goldboot/src/cli/cmd/init.rs:46:16
|
46 | if mold.len() > 0 {
| ^^^^^^^^^^^^^^ help: using !is_empty is clearer and more explicit: !mold.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
goldboot/src/cli/cmd/init.rs|91 col 32| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/cli/cmd/init.rs:91:32
|
91 | .items(&formats)
| ^^^^^^^^ help: change this to: formats
|
= 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
goldboot/src/cli/cmd/init.rs|144 col 40| warning: length comparison to zero
--> goldboot/src/cli/cmd/init.rs:144:40
|
144 | .filter(|mold| foundry.alloy.len() == 0 || mold.alloy())
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using is_empty is clearer and more explicit: foundry.alloy.is_empty()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
goldboot/src/cli/cmd/init.rs|161 col 47| warning: Box::new(_) of default value
--> goldboot/src/cli/cmd/init.rs:161:47
|
161 | mold.prompt(&foundry, Box::new(ColorfulTheme::default()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: Box::<ColorfulTheme>::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_default
= note: #[warn(clippy::box_default)] on by default
goldboot/src/cli/progress.rs|53 col 5| warning: methods called new usually return Self
--> goldboot/src/cli/progress.rs:53:5
|
53 | / pub fn new(&self, len: u64) -> Box<dyn Fn(u64)> {
54 | | if !show_progress() {
55 | | // No progress bar
56 | | return Box::new(|
| {});
... |
66 | | })
67 | | }
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self
= note: #[warn(clippy::new_ret_no_self)] on by default
goldboot/src/cli/progress.rs|100 col 9| warning: this loop could be written as a while let loop
--> goldboot/src/cli/progress.rs:100:9
|
100 | / loop {
101 | | if let Ok(size) = reader.read(&mut buffer) {
102 | | if size == 0 {
103 | | break;
... |
111 | | }
112 | | }
| |
^ help: try: while let Ok(size) = reader.read(&mut buffer) { .. }
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
= note: #[warn(clippy::while_let_loop)] on by default
goldboot/src/cli/progress.rs|105 col 17| error: written amount is not handled
--> goldboot/src/cli/progress.rs:105:17
|
105 | writer.write(&buffer[0..size])?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use Write::write_all instead, or handle partial writes
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
= note: #[deny(clippy::unused_io_amount)] on by default
goldboot/src/cli/progress.rs|119 col 40| warning: this boolean expression can be simplified
--> goldboot/src/cli/progress.rs:119:40
|
119 | std::io::stdout().is_terminal() && !std::env::var("CI").is_ok()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: std::env::var("CI").is_err()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: #[warn(clippy::nonminimal_bool)] on by default
goldboot/src/foundry/fabricators/ansible.rs|29 col 18| warning: single argument that looks like it should be multiple arguments
--> goldboot/src/foundry/fabricators/ansible.rs:29:18
|
29 | .arg("-o StrictHostKeyChecking=no")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_command_arg_space
= note: #[warn(clippy::suspicious_command_arg_space)] on by default
help: consider splitting the argument
|
29 | .args(["-o", "StrictHostKeyChecking=no"])
| ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
goldboot/src/foundry/http.rs|20 col 5| warning: methods called new usually return Self
--> goldboot/src/foundry/http.rs:20:5
|
20 | / pub fn new() -> Result {
21 | | Ok(HttpServerBuilder {
22 | | router: Router::new(),
23 | | directory: tempfile::tempdir()?,
24 | | })
25 | | }
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self
goldboot/src/foundry/http.rs|42 col 59| warning: single-character string constant used as pattern
--> goldboot/src/foundry/http.rs:42:59
|
42 | let path = format!("/{}", path.trim_start_matches("/"));
| ^^^ help: consider using a char: '/'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: #[warn(clippy::single_char_pattern)] on by default
goldboot/src/foundry/molds/alpine_linux/mod.rs|52 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/alpine_linux/mod.rs:52:41
|
52 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Linux)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/molds/arch_linux/mod.rs|55 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/arch_linux/mod.rs:55:41
|
55 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Linux)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/molds/arch_linux/mod.rs|160 col 37| warning: useless use of format!
--> goldboot/src/foundry/molds/arch_linux/mod.rs:160:37
|
160 | let rs = reqwest::blocking::get(format!(
| _____________________________________^
161 | | "http://mirrors.edge.kernel.org/archlinux/iso/latest/sha256sums.txt"
162 | | ))?;
| |
^ help: consider using .to_string(): "http://mirrors.edge.kernel.org/archlinux/iso/latest/sha256sums.txt".to_string()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: #[warn(clippy::useless_format)] on by default
goldboot/src/foundry/molds/arch_linux/mod.rs|164 col 48| warning: filter_map() will run forever if the iterator repeatedly produces an Err
--> goldboot/src/foundry/molds/arch_linux/mod.rs:164:48
|
164 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: map_while(Result::ok)
|
note: this expression returning a std::io::Lines may produce an infinite number of Err in case of a read error
--> goldboot/src/foundry/molds/arch_linux/mod.rs:164:21
|
164 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
= note: #[warn(clippy::lines_filter_map_ok)] on by default
goldboot/src/foundry/molds/debian/mod.rs|50 col 48| warning: filter_map() will run forever if the iterator repeatedly produces an Err
--> goldboot/src/foundry/molds/debian/mod.rs:50:48
|
50 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: map_while(Result::ok)
|
note: this expression returning a std::io::Lines may produce an infinite number of Err in case of a read error
--> goldboot/src/foundry/molds/debian/mod.rs:50:21
|
50 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
goldboot/src/foundry/molds/debian/mod.rs|101 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/debian/mod.rs:101:41
|
101 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Linux)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/molds/goldboot/mod.rs|38 col 1| warning: this impl can be derived
--> goldboot/src/foundry/molds/goldboot/mod.rs:38:1
|
38 | / impl Default for Goldboot {
39 | | fn default() -> Self {
40 | | Self { executable: None }
41 | | }
42 | | }
| |
^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: #[warn(clippy::derivable_impls)] on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
32 + #[derive(Default)]
33 | pub struct Goldboot {
|
goldboot/src/foundry/molds/goldboot/mod.rs|66 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/goldboot/mod.rs:66:41
|
66 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Linux)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/molds/goldboot/mod.rs|146 col 49| warning: single-character string constant used as pattern
--> goldboot/src/foundry/molds/goldboot/mod.rs:146:49
|
146 | Some(Value::String(name)) => name.split(".").last().unwrap().parse::().unwrap(),
| ^^^ help: consider using a char: '.'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
goldboot/src/foundry/molds/nix/mod.rs|59 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/nix/mod.rs:59:41
|
59 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Linux)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/molds/windows_10/mod.rs|39 col 9| warning: this if branch is empty
--> goldboot/src/foundry/molds/windows_10/mod.rs:39:9
|
39 | / if dialoguer::Confirm::with_theme(&*theme).with_prompt("Perform minimal install? This will remove as many unnecessary programs as...
40 | |
41 | | }
| |
^ help: you can remove it: dialoguer::Confirm::with_theme(&*theme).with_prompt("Perform minimal install? This will remove as many unnecessary programs as possible.").interact()?;
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_if
= note: #[warn(clippy::needless_if)] on by default
goldboot/src/foundry/molds/windows_10/mod.rs|157 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/windows_10/mod.rs:157:41
|
157 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Windows)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/molds/windows_11/mod.rs|35 col 9| warning: this if branch is empty
--> goldboot/src/foundry/molds/windows_11/mod.rs:35:9
|
35 | / if dialoguer::Confirm::with_theme(&*theme).with_prompt("Perform minimal install? This will remove as many unnecessary programs as...
36 | |
37 | | }
| |
^ help: you can remove it: dialoguer::Confirm::with_theme(&*theme).with_prompt("Perform minimal install? This will remove as many unnecessary programs as possible.").interact()?;
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_if
goldboot/src/foundry/molds/windows_11/mod.rs|169 col 41| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/molds/windows_11/mod.rs:169:41
|
169 | let mut qemu = QemuBuilder::new(&worker, OsCategory::Windows)
| ^^^^^^^ help: change this to: worker
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/qemu.rs|134 col 9| warning: question mark operator is useless here
--> goldboot/src/foundry/qemu.rs:134:9
|
134 | / Ok(SshConnection::new(
135 | | username,
136 | | &self.private_key,
137 | | self.ssh_port,
138 | | )?)
| |
^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: #[warn(clippy::needless_question_mark)] on by default
help: try removing question mark and Ok()
|
134 ~ SshConnection::new(
135 + username,
136 + &self.private_key,
137 + self.ssh_port,
138 + )
|
goldboot/src/foundry/qemu.rs|174 col 1| warning: an implementation of From is preferred since it gives you Into<_> for free where the reverse isn't true
--> goldboot/src/foundry/qemu.rs:174:1
|
174 | impl Into<Vec> for QemuArgs {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: impl From<Local> for Foreign is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: #[warn(clippy::from_over_into)] on by default
help: replace the Into implementation with From<foundry::qemu::QemuArgs>
|
174 ~ impl From for Vec {
175 ~ fn from(val: QemuArgs) -> Self {
176 | let mut cmdline = vec![
177 | String::from("-name"),
178 ~ val.name.clone(),
179 | String::from("-bios"),
180 ~ val.bios.clone(),
181 | String::from("-m"),
182 ~ val.memory.clone(),
183 | String::from("-boot"),
184 ~ val.boot.clone(),
185 | String::from("-display"),
186 ~ val.display.clone(),
187 | String::from("-smp"),
188 ~ val.smp.clone(),
189 | String::from("-machine"),
190 ~ val.machine.clone(),
191 | String::from("-rtc"),
...
194 |
195 ~ if let Some(cpu) = &val.cpu {
196 | cmdline.push(String::from("-cpu"));
...
199 |
200 ~ if let Some(smbios) = &val.smbios {
201 | cmdline.push(String::from("-smbios"));
...
204 |
205 ~ for usbdevice in &val.usbdevice {
206 | cmdline.push(String::from("-usbdevice"));
...
209 |
210 ~ for global in &val.global {
211 | cmdline.push(String::from("-global"));
...
214 |
215 ~ for drive in &val.drive {
216 | cmdline.push(String::from("-drive"));
...
219 |
220 ~ for netdev in &val.netdev {
221 | cmdline.push(String::from("-netdev"));
...
224 |
225 ~ for vnc in &val.vnc {
226 | cmdline.push(String::from("-vnc"));
...
229 |
230 ~ for blockdev in &val.blockdev {
231 | cmdline.push(String::from("-blockdev"));
...
234 |
235 ~ for chardev in &val.chardev {
236 | cmdline.push(String::from("-chardev"));
...
239 |
240 ~ for tpmdev in &val.tpmdev {
241 | cmdline.push(String::from("-tpmdev"));
...
244 |
245 ~ for device in &val.device {
246 | cmdline.push(String::from("-device"));
...
250 | cmdline.push(String::from("-vga"));
251 ~ cmdline.push(val.vga.to_string());
|
goldboot/src/foundry/qemu.rs|389 col 18| warning: file opened with create, but truncate behavior not defined
--> goldboot/src/foundry/qemu.rs:389:18
|
389 | .create(true)
| ^^^^^^^^^^^^- help: add: .truncate(true)
|
= help: if you intend to overwrite an existing file entirely, call .truncate(true)
= help: if you instead know that you may want to keep some parts of the old file, call .truncate(false)
= help: alternatively, use .append(true) to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
= note: #[warn(clippy::suspicious_open_options)] on by default
goldboot/src/foundry/qemu.rs|401 col 18| warning: file opened with create, but truncate behavior not defined
--> goldboot/src/foundry/qemu.rs:401:18
|
401 | .create(true)
| ^^^^^^^^^^^^- help: add: .truncate(true)
|
= help: if you intend to overwrite an existing file entirely, call .truncate(true)
= help: if you instead know that you may want to keep some parts of the old file, call .truncate(false)
= help: alternatively, use .append(true) to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
goldboot/src/foundry/qemu.rs|445 col 18| warning: file opened with create, but truncate behavior not defined
--> goldboot/src/foundry/qemu.rs:445:18
|
445 | .create(true)
| ^^^^^^^^^^^^- help: add: .truncate(true)
|
= help: if you intend to overwrite an existing file entirely, call .truncate(true)
= help: if you instead know that you may want to keep some parts of the old file, call .truncate(false)
= help: alternatively, use .append(true) to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
goldboot/src/foundry/qemu.rs|460 col 18| warning: file opened with create, but truncate behavior not defined
--> goldboot/src/foundry/qemu.rs:460:18
|
460 | .create(true)
| ^^^^^^^^^^^^- help: add: .truncate(true)
|
= help: if you intend to overwrite an existing file entirely, call .truncate(true)
= help: if you instead know that you may want to keep some parts of the old file, call .truncate(false)
= help: alternatively, use .append(true) to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
goldboot/src/foundry/qemu.rs|491 col 9| warning: question mark operator is useless here
--> goldboot/src/foundry/qemu.rs:491:9
|
491 | / Ok(self.drive_files(HashMap::from([
492 | | ("sshdog".to_string(), sshdog),
493 | | ("host_key".to_string(), host_key),
494 | | ("public_key".to_string(), public_key),
495 | | ]))?)
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
help: try removing question mark and Ok()
|
491 ~ self.drive_files(HashMap::from([
492 + ("sshdog".to_string(), sshdog),
493 + ("host_key".to_string(), host_key),
494 + ("public_key".to_string(), public_key),
495 + ]))
|
goldboot/src/foundry/qemu.rs|514 col 30| warning: length comparison to zero
--> goldboot/src/foundry/qemu.rs:514:30
|
514 | let tpm_process = if self.args.tpmdev.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using !is_empty is clearer and more explicit: !self.args.tpmdev.is_empty()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
goldboot/src/foundry/sources/mod.rs|42 col 5| warning: method default can be confused for the standard trait method std::default::Default::default
--> goldboot/src/foundry/sources/mod.rs:42:5
|
42 | / pub fn default() -> Result {
43 | | let directory = if cfg!(target_os = "linux") {
44 | | PathBuf::from(format!(
45 | | "/home/{}/.cache/goldboot/sources",
... |
64 | | Ok(Self { directory })
65 | | }
| |
_^
|
= help: consider implementing the trait std::default::Default or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
= note: #[warn(clippy::should_implement_trait)] on by default
goldboot/src/foundry/sources/mod.rs|74 col 20| warning: this boolean expression can be simplified
--> goldboot/src/foundry/sources/mod.rs:74:20
|
74 | if !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
| ____________________^
75 | | .is_ok()
| |___^ help: try: Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str()).is_err()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
goldboot/src/foundry/sources/mod.rs|117 col 43| warning: single-character string constant used as pattern
--> goldboot/src/foundry/sources/mod.rs:117:43
|
117 | let c: Vec<&str> = checksum.split(":").collect();
| ^^^ help: consider using a char: ':'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
goldboot/src/foundry/ssh.rs|34 col 9| warning: the borrowed expression implements the required traits
--> goldboot/src/foundry/ssh.rs:34:9
|
34 | &key_path.with_extension("pub"),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: key_path.with_extension("pub")
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: #[warn(clippy::needless_borrows_for_generic_args)] on by default
goldboot/src/foundry/ssh.rs|61 col 12| warning: this creates an owned instance just for comparison
--> goldboot/src/foundry/ssh.rs:61:12
|
61 | if entry
| ^
62 | | .path()?
63 | | .file_stem()
64 | | .unwrap()
65 | | .to_string_lossy()
66 | | .to_string()
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
= note: #[warn(clippy::cmp_owned)] on by default
help: try
|
61 ~ if entry
62 + .path()?
63 + .file_stem()
64 + .unwrap()
65 + .to_string_lossy()
|
goldboot/src/foundry/ssh.rs|115 col 45| warning: writing &PathBuf instead of &Path involves a new object where a slice will do
--> goldboot/src/foundry/ssh.rs:115:45
|
115 | fn connect(username: &str, private_key: &PathBuf, port: u16) -> Result {
| ^^^^^^^^ help: change this to: &Path
|
= 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
goldboot/src/foundry/ssh.rs|186 col 28| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/ssh.rs:186:28
|
186 | channel.setenv(&var, &val)?;
| ^^^^ help: change this to: var
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/ssh.rs|186 col 34| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/ssh.rs:186:34
|
186 | channel.setenv(&var, &val)?;
| ^^^^ help: change this to: val
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
goldboot/src/foundry/ssh.rs|201 col 47| warning: single-character string constant used as pattern
--> goldboot/src/foundry/ssh.rs:201:47
|
201 | .or(line.strip_suffix("\n"))
| ^^^^ help: consider using a char: '\n'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
goldboot/src/foundry/vnc.rs|29 col 13| warning: ref on an entire let pattern is discouraged, take a reference with & instead
--> goldboot/src/foundry/vnc.rs:29:13
|
29 | let ref mut w = BufWriter::new(File::create(output_path)?);
| ----^^^^^^^^^---------------------------------------------- help: try: let w = &mut BufWriter::new(File::create(output_path)?);
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg
= note: #[warn(clippy::toplevel_ref_arg)] on by default
goldboot/src/foundry/vnc.rs|165 col 13| warning: you seem to be trying to use match for destructuring a single pattern. Consider using if let
--> goldboot/src/foundry/vnc.rs:165:13
|
165 | / match event {
166 | | Event::Resize(width, height) => {
167 | | self.width = width;
168 | | self.height = height;
169 | | }
170 | | _ => {}
171 | | }
| |
^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: #[warn(clippy::single_match)] on by default
help: try
|
165 ~ if let Event::Resize(width, height) = event {
166 + self.width = width;
167 + self.height = height;
168 + }
|
goldboot/src/foundry/vnc.rs|240 col 42| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/foundry/vnc.rs:240:42
|
240 | screenshot.write_png(&Path::new(&format!("screenshots/{hash}.png")))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: Path::new(&format!("screenshots/{hash}.png"))
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
... (Too many findings. Dropped some findings)