wip: initial replacement of GTK UI #185
Annotations
9 errors and 220 warnings
|
[clippy] goldboot/src/cli/cmd/image.rs#L17:
goldboot/src/cli/cmd/image.rs#L17
error: this loop never actually loops
--> goldboot/src/cli/cmd/image.rs:17:17
|
17 | / for image in images {
18 | | println!(
19 | | "{:15} {:12} {:31} {:12} {}",
20 | | todo!(),
... |
27 | | );
28 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#never_loop
= note: `#[deny(clippy::never_loop)]` on by default
help: if you need the first element of the iterator, try writing
|
17 - for image in images {
17 + if let Some(image) = images.into_iter().next() {
|
|
|
[clippy] goldboot/src/cli/progress.rs#L105:
goldboot/src/cli/progress.rs#L105
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/rust-1.91.0/index.html#unused_io_amount
= note: `#[deny(clippy::unused_io_amount)]` on by default
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L17:
goldboot/src/cli/cmd/image.rs#L17
error: this loop never actually loops
--> goldboot/src/cli/cmd/image.rs:17:17
|
17 | / for image in images {
18 | | println!(
19 | | "{:15} {:12} {:31} {:12} {}",
20 | | todo!(),
... |
27 | | );
28 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#never_loop
= note: `#[deny(clippy::never_loop)]` on by default
help: if you need the first element of the iterator, try writing
|
17 - for image in images {
17 + if let Some(image) = images.into_iter().next() {
|
|
|
[clippy] goldboot/src/cli/progress.rs#L105:
goldboot/src/cli/progress.rs#L105
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/beta/index.html#unused_io_amount
= note: `#[deny(clippy::unused_io_amount)]` on by default
|
|
ubuntu / stable
Process completed with exit code 101.
|
|
ubuntu / beta
The strategy configuration was canceled because "required.stable" failed
|
|
ubuntu / beta
The operation was canceled.
|
|
windows-latest / stable
Process completed with exit code 1.
|
|
macos-latest / stable
Process completed with exit code 101.
|
|
[clippy] goldboot-image/src/lib.rs#L471:
goldboot-image/src/lib.rs#L471
warning: empty line after doc comment
--> goldboot-image/src/lib.rs:468:5
|
468 | / /// TODO write backup GPT header
469 | |
| |_^
470 | /// Write the image contents out to disk.
471 | pub fn write<F: Fn(u64, u64) -> ()>(&self, dest: impl AsRef<Path>, progress: F) -> Result<()> {
| ------------ the comment documents this function
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#empty_line_after_doc_comments
= note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
= help: if the empty line is unintentional, remove it
help: if the documentation should include the empty line include it in the comment
|
469 | ///
|
|
|
[clippy] goldboot-image/src/lib.rs#L1:
goldboot-image/src/lib.rs#L1
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/rust-1.91.0/index.html#empty_docs
= note: `#[warn(clippy::empty_docs)]` on by default
|
|
[clippy] goldboot-image/src/qcow/mod.rs#L68:
goldboot-image/src/qcow/mod.rs#L68
warning: unnecessary use of `to_string`
--> goldboot-image/src/qcow/mod.rs:68:17
|
68 | &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/rust-1.91.0/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L422:
goldboot-image/src/lib.rs#L422
warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:422:28
|
422 | compute_id(&path).unwrap()
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L425:
goldboot-image/src/lib.rs#L425
warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:425:24
|
425 | compute_id(&path).unwrap()
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrows_for_generic_args
|
|
[clippy] goldboot-image/src/lib.rs#L443:
goldboot-image/src/lib.rs#L443
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/rust-1.91.0/index.html#needless_borrows_for_generic_args
|
|
[clippy] goldboot-image/src/lib.rs#L453:
goldboot-image/src/lib.rs#L453
warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:453:46
|
453 | file_size: std::fs::metadata(&path)?.len(),
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrows_for_generic_args
|
|
[clippy] goldboot-image/src/lib.rs#L471:
goldboot-image/src/lib.rs#L471
warning: unneeded unit return type
--> goldboot-image/src/lib.rs:471:33
|
471 | pub fn write<F: Fn(u64, u64) -> ()>(&self, dest: impl AsRef<Path>, progress: F) -> Result<()> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#unused_unit
= note: `#[warn(clippy::unused_unit)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L486:
goldboot-image/src/lib.rs#L486
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot-image/src/lib.rs:486:14
|
486 | .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/rust-1.91.0/index.html#suspicious_open_options
= note: `#[warn(clippy::suspicious_open_options)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L504:
goldboot-image/src/lib.rs#L504
warning: the loop variable `i` is used to index `digest_table`
--> goldboot-image/src/lib.rs:504:18
|
504 | for i in 0..protected_header.cluster_count as usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
504 - for i in 0..protected_header.cluster_count as usize {
504 + for (i, <item>) in digest_table.iter().enumerate().take(protected_header.cluster_count as usize) {
|
|
|
[clippy] goldboot-image/src/lib.rs#L569:
goldboot-image/src/lib.rs#L569
warning: unneeded unit return type
--> goldboot-image/src/lib.rs:569:37
|
569 | pub fn from_qcow<F: Fn(u64, u64) -> ()>(
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#unused_unit
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L3:
goldboot/src/cli/cmd/init.rs#L3
warning: unused imports: `Input` and `Password`
--> goldboot/src/cli/cmd/init.rs:3:26
|
3 | use dialoguer::{Confirm, Input, Password, Select, theme::ColorfulTheme};
| ^^^^^ ^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] goldboot/src/cli/cmd/liveusb.rs#L6:
goldboot/src/cli/cmd/liveusb.rs#L6
warning: unused import: `builder::os::Os`
--> goldboot/src/cli/cmd/liveusb.rs:6:41
|
6 | use crate::{cli::progress::ProgressBar, builder::os::Os, library::ImageLibrary};
| ^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/config.rs#L5:
goldboot/src/config.rs#L5
warning: unused imports: `IntoPyDict`, `PyModule`, and `ffi::c_str`
--> goldboot/src/config.rs:5:5
|
5 | ffi::c_str,
| ^^^^^^^^^^
6 | prelude::*,
7 | types::{IntoPyDict, PyModule},
| ^^^^^^^^^^ ^^^^^^^^
|
|
[clippy] goldboot/src/config.rs#L15:
goldboot/src/config.rs#L15
warning: unused imports: `thread` and `time::SystemTime`
--> goldboot/src/config.rs:15:5
|
15 | thread,
| ^^^^^^
16 | time::SystemTime,
| ^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/config.rs#L20:
goldboot/src/config.rs#L20
warning: unused import: `Builder`
--> goldboot/src/config.rs:20:22
|
20 | use crate::builder::{Builder, os::Os};
| ^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L2:
goldboot/src/builder/mod.rs#L2
warning: unused import: `fabricators::Fabricator`
--> goldboot/src/builder/mod.rs:2:12
|
2 | use self::{fabricators::Fabricator, os::Os};
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L8:
goldboot/src/builder/mod.rs#L8
warning: unused import: `anyhow`
--> goldboot/src/builder/mod.rs:8:22
|
8 | use anyhow::{Result, anyhow, bail};
| ^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L9:
goldboot/src/builder/mod.rs#L9
warning: unused import: `byte_unit::Byte`
--> goldboot/src/builder/mod.rs:9:5
|
9 | use byte_unit::Byte;
| ^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L11:
goldboot/src/builder/mod.rs#L11
warning: unused import: `goldboot_image::ElementHeader`
--> goldboot/src/builder/mod.rs:11:5
|
11 | use goldboot_image::ElementHeader;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L14:
goldboot/src/builder/mod.rs#L14
warning: unused imports: `Deserialize` and `Serialize`
--> goldboot/src/builder/mod.rs:14:13
|
14 | use serde::{Deserialize, Serialize};
| ^^^^^^^^^^^ ^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L16:
goldboot/src/builder/mod.rs#L16
warning: unused imports: `Path` and `thread`
--> goldboot/src/builder/mod.rs:16:12
|
16 | path::{Path, PathBuf},
| ^^^^
17 | thread,
| ^^^^^^
|
|
[clippy] goldboot/src/builder/os/alpine_linux/mod.rs#L2:
goldboot/src/builder/os/alpine_linux/mod.rs#L2
warning: unused import: `goldboot_image::ImageArch`
--> goldboot/src/builder/os/alpine_linux/mod.rs:2:5
|
2 | use goldboot_image::ImageArch;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/vnc.rs#L408:
goldboot/src/builder/vnc.rs#L408
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:408:17
|
408 | crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
= note: `#[warn(clippy::crate_in_macro_def)]` on by default
|
|
[clippy] goldboot/src/builder/vnc.rs#L425:
goldboot/src/builder/vnc.rs#L425
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:425:17
|
425 | crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L435:
goldboot/src/builder/vnc.rs#L435
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:435:17
|
435 | crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L445:
goldboot/src/builder/vnc.rs#L445
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:445:17
|
445 | crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L461:
goldboot/src/builder/vnc.rs#L461
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:461:18
|
461 | vec![crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L468:
goldboot/src/builder/vnc.rs#L468
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:468:18
|
468 | vec![crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L475:
goldboot/src/builder/vnc.rs#L475
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:475:18
|
475 | vec![crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L489:
goldboot/src/builder/vnc.rs#L489
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:489:17
|
489 | crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L499:
goldboot/src/builder/vnc.rs#L499
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:499:17
|
499 | crate::builder::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/rust-1.91.0/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/library.rs#L1:
goldboot/src/library.rs#L1
warning: unused import: `builder::os::Os`
--> goldboot/src/library.rs:1:41
|
1 | use crate::{cli::progress::ProgressBar, builder::os::Os};
| ^^^^^^^^^^^^^^^
|
|
[clippy] /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/macros/mod.rs#L879:
/rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/macros/mod.rs#L879
warning: unreachable expression
--> goldboot/src/cli/cmd/image.rs:18:21
|
18 | / println!(
19 | | "{:15} {:12} {:31} {:12} {}",
20 | | todo!(),
| | ------- any code following this expression is unreachable
21 | | image.primary_header.size.bytes().to_string(),
... |
26 | | "TODO",
27 | | );
| |_____________________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L23:
goldboot/src/cli/cmd/image.rs#L23
warning: use of deprecated method `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> goldboot/src/cli/cmd/image.rs:23:30
|
23 | ... .timestamp(image.primary_header.timestamp as i64, 0)
| ^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
|
|
[clippy] goldboot/src/builder/qemu.rs#L308:
goldboot/src/builder/qemu.rs#L308
warning: unreachable expression
--> goldboot/src/builder/qemu.rs:308:23
|
307 | memory: todo!(),
| ------- any code following this expression is unreachable
308 | name: String::from("goldboot"),
| ^^^^^^^^^^^^^^^^^^^^^^^^ unreachable expression
|
|
[clippy] goldboot/src/registry/api/image.rs#L28:
goldboot/src/registry/api/image.rs#L28
warning: unreachable expression
--> goldboot/src/registry/api/image.rs:28:19
|
27 | name: todo!(),
| ------- any code following this expression is unreachable
28 | arch: value.primary_header.arch,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable expression
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L2:
goldboot/src/builder/os/arch_linux/mod.rs#L2
warning: unused import: `crate::builder::fabricators::Fabricate`
--> goldboot/src/builder/os/arch_linux/mod.rs:2:5
|
2 | use crate::builder::fabricators::Fabricate;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/windows_10/mod.rs#L17:
goldboot/src/builder/os/windows_10/mod.rs#L17
warning: unused import: `cli::prompt::Prompt`
--> goldboot/src/builder/os/windows_10/mod.rs:17:5
|
17 | cli::prompt::Prompt,
| ^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/windows_11/mod.rs#L16:
goldboot/src/builder/os/windows_11/mod.rs#L16
warning: unused import: `cli::prompt::Prompt`
--> goldboot/src/builder/os/windows_11/mod.rs:16:5
|
16 | cli::prompt::Prompt,
| ^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L17:
goldboot/src/cli/cmd/image.rs#L17
warning: unused variable: `image`
--> goldboot/src/cli/cmd/image.rs:17:21
|
17 | for image in images {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_image`
|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L38:
goldboot/src/cli/cmd/init.rs#L38
warning: unused variable: `name`
--> goldboot/src/cli/cmd/init.rs:38:13
|
38 | name,
| ^^^^ help: try ignoring the field: `name: _`
|
|
[clippy] goldboot/src/cli/cmd/liveusb.rs#L12:
goldboot/src/cli/cmd/liveusb.rs#L12
warning: unused variable: `include`
--> goldboot/src/cli/cmd/liveusb.rs:12:13
|
12 | include,
| ^^^^^^^ help: try ignoring the field: `include: _`
|
|
[clippy] goldboot/src/builder/options/arch.rs#L10:
goldboot/src/builder/options/arch.rs#L10
warning: unused variable: `builder`
--> goldboot/src/builder/options/arch.rs:10:26
|
10 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/options/hostname.rs#L30:
goldboot/src/builder/options/hostname.rs#L30
warning: unused variable: `builder`
--> goldboot/src/builder/options/hostname.rs:30:26
|
30 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/options/size.rs#L18:
goldboot/src/builder/options/size.rs#L18
warning: unused variable: `builder`
--> goldboot/src/builder/options/size.rs:18:26
|
18 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/os/debian/mod.rs#L106:
goldboot/src/builder/os/debian/mod.rs#L106
warning: unused variable: `builder`
--> goldboot/src/builder/os/debian/mod.rs:106:26
|
106 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/qemu.rs#L269:
goldboot/src/builder/qemu.rs#L269
warning: unused variable: `ssh_port`
--> goldboot/src/builder/qemu.rs:269:13
|
269 | let ssh_port = rand::rng().random_range(10000..11000);
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ssh_port`
|
|
[clippy] goldboot/src/builder/qemu.rs#L270:
goldboot/src/builder/qemu.rs#L270
warning: unused variable: `ssh_private_key`
--> goldboot/src/builder/qemu.rs:270:13
|
270 | let ssh_private_key = crate::builder::ssh::generate_key(worker.tmp.path()).unwrap();
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ssh_private_key`
|
|
[clippy] goldboot/src/builder/qemu.rs#L271:
goldboot/src/builder/qemu.rs#L271
warning: unused variable: `ssh_host_key`
--> goldboot/src/builder/qemu.rs:271:13
|
271 | let ssh_host_key = crate::builder::ssh::generate_key(worker.tmp.path()).unwrap();
| ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ssh_host_key`
|
|
[clippy] goldboot/src/builder/ssh.rs#L230:
goldboot/src/builder/ssh.rs#L230
warning: unused variable: `session`
--> goldboot/src/builder/ssh.rs:230:13
|
230 | fn query_os(session: &ssh2::Session) -> Result<OsCategory> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_session`
|
|
[clippy] goldboot/src/builder/mod.rs#L83:
goldboot/src/builder/mod.rs#L83
warning: unused variable: `element`
--> goldboot/src/builder/mod.rs:83:18
|
83 | Some(element) => {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_element`
|
|
[clippy] goldboot/src/builder/mod.rs#L107:
goldboot/src/builder/mod.rs#L107
warning: unused variable: `path`
--> goldboot/src/builder/mod.rs:107:17
|
107 | path,
| ^^^^ help: try ignoring the field: `path: _`
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L40:
goldboot/src/builder/os/arch_linux/mod.rs#L40
warning: type `builder::os::arch_linux::ArchLinuxPackages` is more private than the item `builder::os::arch_linux::ArchLinux::packages`
--> goldboot/src/builder/os/arch_linux/mod.rs:40:5
|
40 | pub packages: Option<ArchLinuxPackages>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `builder::os::arch_linux::ArchLinux::packages` is reachable at visibility `pub`
|
note: but type `builder::os::arch_linux::ArchLinuxPackages` is only usable at visibility `pub(self)`
--> goldboot/src/builder/os/arch_linux/mod.rs:181:1
|
181 | struct ArchLinuxPackages(Vec<String>);
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
|
|
[clippy] goldboot/src/builder/os/nix/mod.rs#L35:
goldboot/src/builder/os/nix/mod.rs#L35
warning: type `builder::os::nix::ConfigurationPath` is more private than the item `builder::os::nix::Nix::configuration`
--> goldboot/src/builder/os/nix/mod.rs:35:5
|
35 | pub configuration: ConfigurationPath,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `builder::os::nix::Nix::configuration` is reachable at visibility `pub`
|
note: but type `builder::os::nix::ConfigurationPath` is only usable at visibility `pub(self)`
--> goldboot/src/builder/os/nix/mod.rs:82:1
|
82 | struct ConfigurationPath(PathBuf);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/nix/mod.rs#L38:
goldboot/src/builder/os/nix/mod.rs#L38
warning: type `builder::os::nix::ConfigurationPath` is more private than the item `builder::os::nix::Nix::hardware_configuration`
--> goldboot/src/builder/os/nix/mod.rs:38:5
|
38 | pub hardware_configuration: Option<ConfigurationPath>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `builder::os::nix::Nix::hardware_configuration` is reachable at visibility `pub`
|
note: but type `builder::os::nix::ConfigurationPath` is only usable at visibility `pub(self)`
--> goldboot/src/builder/os/nix/mod.rs:82:1
|
82 | struct ConfigurationPath(PathBuf);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L155:
goldboot/src/builder/os/arch_linux/mod.rs#L155
warning: function `fetch_latest_iso` is never used
--> goldboot/src/builder/os/arch_linux/mod.rs:155:4
|
155 | fn fetch_latest_iso() -> Result<Iso> {
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] goldboot/src/cli/cmd/deploy.rs#L36:
goldboot/src/cli/cmd/deploy.rs#L36
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()
... |
44 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
36 ~ if Path::new(&output).exists() && !confirm
37 ~ && !Confirm::with_theme(&theme)
38 | .with_prompt("Do you want to continue?")
...
42 | std::process::exit(0);
43 ~ }
|
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L26:
goldboot/src/cli/cmd/image.rs#L26
warning: literal with an empty format string
--> goldboot/src/cli/cmd/image.rs:26:25
|
26 | "TODO",
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#print_literal
= note: `#[warn(clippy::print_literal)]` on by default
help: try
|
19 ~ "{:15} {:12} {:31} {:12} TODO",
20 | todo!(),
...
24 | .to_rfc2822(),
25 ~ &image.id[0..12],
|
|
|
[clippy] /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/macros/mod.rs#L879:
/rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/macros/mod.rs#L879
warning: sub-expression diverges
--> goldboot/src/cli/cmd/image.rs:20:25
|
20 | todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#diverging_sub_expression
= note: `#[warn(clippy::diverging_sub_expression)]` on by default
= note: this warning originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L19:
goldboot/src/cli/cmd/init.rs#L19
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/rust-1.91.0/index.html#print_literal
help: try
|
19 - println!("{}", "");
19 + println!("");
|
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L23:
goldboot/src/cli/cmd/init.rs#L23
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/rust-1.91.0/index.html#print_literal
help: try
|
23 - println!("{}", "");
23 + println!("");
|
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L46:
goldboot/src/cli/cmd/init.rs#L46
warning: length comparison to zero
--> goldboot/src/cli/cmd/init.rs:46:16
|
46 | if builder.elements.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `builder.elements.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L101:
goldboot/src/cli/cmd/init.rs#L101
warning: length comparison to zero
--> goldboot/src/cli/cmd/init.rs:101:38
|
101 | .filter(|os| builder.elements.len() == 0 || os.alloy())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `builder.elements.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#len_zero
|
|
[clippy] goldboot/src/cli/cmd/liveusb.rs#L35:
goldboot/src/cli/cmd/liveusb.rs#L35
warning: this `if` statement can be collapsed
--> goldboot/src/cli/cmd/liveusb.rs:35:13
|
35 | / if !confirm {
36 | | if !Confirm::with_theme(&theme)
37 | | .with_prompt(format!("Do you want to overwrite: {}?", dest))
38 | | .interact()
... |
43 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#collapsible_if
help: collapse nested if block
|
35 ~ if !confirm
36 ~ && !Confirm::with_theme(&theme)
37 | .with_prompt(format!("Do you want to overwrite: {}?", dest))
...
41 | return ExitCode::FAILURE;
42 ~ }
|
|
|
[clippy] goldboot/src/cli/progress.rs#L53:
goldboot/src/cli/progress.rs#L53
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/rust-1.91.0/index.html#new_ret_no_self
= note: `#[warn(clippy::new_ret_no_self)]` on by default
|
|
[clippy] goldboot/src/cli/progress.rs#L100:
goldboot/src/cli/progress.rs#L100
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;
... |
112 | | }
| |_________^ help: try: `while let Ok(size) = reader.read(&mut buffer) { .. }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#while_let_loop
= note: `#[warn(clippy::while_let_loop)]` on by default
|
|
[clippy] goldboot/src/cli/progress.rs#L119:
goldboot/src/cli/progress.rs#L119
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/rust-1.91.0/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
|
[clippy] goldboot/src/config.rs#L31:
goldboot/src/config.rs#L31
warning: redundant closure
--> goldboot/src/config.rs:31:69
|
31 | let items: Result<Vec<String>, _> = elements.iter().map(|os| format_os(os)).collect();
| ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `format_os`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
|
[clippy] goldboot/src/config.rs#L322:
goldboot/src/config.rs#L322
warning: large size difference between variants
--> goldboot/src/config.rs:322:1
|
322 | / enum SingleOrMultiple {
323 | | Single(Os),
| | ---------- the largest variant contains at least 248 bytes
324 | | Multiple(Vec<Os>),
| | ----------------- the second-largest variant contains at least 24 bytes
325 | | }
| |_^ the entire enum is at least 248 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum
|
323 - Single(Os),
323 + Single(Box<Os>),
|
|
|
[clippy] goldboot/src/builder/fabricators/ansible.rs#L28:
goldboot/src/builder/fabricators/ansible.rs#L28
warning: single argument that looks like it should be multiple arguments
--> goldboot/src/builder/fabricators/ansible.rs:28:18
|
28 | .arg("-o StrictHostKeyChecking=no")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#suspicious_command_arg_space
= note: `#[warn(clippy::suspicious_command_arg_space)]` on by default
help: consider splitting the argument
|
28 - .arg("-o StrictHostKeyChecking=no")
28 + .args(["-o", "StrictHostKeyChecking=no"])
|
|
|
[clippy] goldboot/src/builder/fabricators/ansible.rs#L66:
goldboot/src/builder/fabricators/ansible.rs#L66
warning: this `if` statement can be collapsed
--> goldboot/src/builder/fabricators/ansible.rs:66:9
|
66 | / if !Path::new(&self.playbook).exists() {
67 | | if !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
68 | | .with_prompt("The path does not exist. Add anyway?")
69 | | .interact()?
... |
73 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#collapsible_if
help: collapse nested if block
|
66 ~ if !Path::new(&self.playbook).exists()
67 ~ && !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
68 | .with_prompt("The path does not exist. Add anyway?")
...
71 | bail!("The playbook did not exist");
72 ~ }
|
|
|
[clippy] goldboot/src/builder/fabricators/exe.rs#L35:
goldboot/src/builder/fabricators/exe.rs#L35
warning: this `if` statement can be collapsed
--> goldboot/src/builder/fabricators/exe.rs:35:9
|
35 | / if !Path::new(&self.path).exists() {
36 | | if !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
37 | | .with_prompt("The path does not exist. Add anyway?")
38 | | .interact()?
... |
42 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#collapsible_if
help: collapse nested if block
|
35 ~ if !Path::new(&self.path).exists()
36 ~ && !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
37 | .with_prompt("The path does not exist. Add anyway?")
...
40 | bail!("The playbook did not exist");
41 ~ }
|
|
|
[clippy] goldboot/src/builder/http.rs#L20:
goldboot/src/builder/http.rs#L20
warning: methods called `new` usually return `Self`
--> goldboot/src/builder/http.rs:20:5
|
20 | / pub fn new() -> Result<HttpServerBuilder> {
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/rust-1.91.0/index.html#new_ret_no_self
|
|
[clippy] goldboot/src/builder/options/size.rs#L51:
goldboot/src/builder/options/size.rs#L51
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> goldboot/src/builder/options/size.rs:51:1
|
51 | impl Into<u64> for Size {
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= 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/rust-1.91.0/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<builder::options::size::Size>`
|
51 ~ impl From<Size> for u64 {
52 ~ fn from(val: Size) -> Self {
53 | // Assume Size was validated previously
54 ~ val.0
|
|
|
[clippy] goldboot/src/builder/os/alpine_linux/mod.rs#L39:
goldboot/src/builder/os/alpine_linux/mod.rs#L39
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/alpine_linux/mod.rs:39:41
|
39 | 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/rust-1.91.0/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L51:
goldboot/src/builder/os/arch_linux/mod.rs#L51
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/arch_linux/mod.rs:51:41
|
51 | 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/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L156:
goldboot/src/builder/os/arch_linux/mod.rs#L156
warning: useless use of `format!`
--> goldboot/src/builder/os/arch_linux/mod.rs:156:37
|
156 | let rs = reqwest::blocking::get(format!(
| _____________________________________^
157 | | "http://mirrors.edge.kernel.org/archlinux/iso/latest/sha256sums.txt"
158 | | ))?;
| |_____^ 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/rust-1.91.0/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L160:
goldboot/src/builder/os/arch_linux/mod.rs#L160
warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
--> goldboot/src/builder/os/arch_linux/mod.rs:160:48
|
160 | 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/builder/os/arch_linux/mod.rs:160:21
|
160 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#lines_filter_map_ok
= note: `#[warn(clippy::lines_filter_map_ok)]` on by default
|
|
[clippy] goldboot/src/builder/os/debian/mod.rs#L48:
goldboot/src/builder/os/debian/mod.rs#L48
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/debian/mod.rs:48:41
|
48 | 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/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/debian/mod.rs#L137:
goldboot/src/builder/os/debian/mod.rs#L137
warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
--> goldboot/src/builder/os/debian/mod.rs:137:48
|
137 | 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/builder/os/debian/mod.rs:137:21
|
137 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#lines_filter_map_ok
|
|
[clippy] goldboot/src/builder/os/nix/mod.rs#L49:
goldboot/src/builder/os/nix/mod.rs#L49
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/nix/mod.rs:49:41
|
49 | 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/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/windows_10/mod.rs#L146:
goldboot/src/builder/os/windows_10/mod.rs#L146
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/windows_10/mod.rs:146:41
|
146 | 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/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/windows_11/mod.rs#L158:
goldboot/src/builder/os/windows_11/mod.rs#L158
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/windows_11/mod.rs:158:41
|
158 | 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/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/qemu.rs#L130:
goldboot/src/builder/qemu.rs#L130
warning: enclosing `Ok` and `?` operator are unneeded
--> goldboot/src/builder/qemu.rs:130:9
|
130 | / Ok(SshConnection::new(
131 | | username,
132 | | &self.private_key,
133 | | self.ssh_port,
134 | | )?)
| |___________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
help: remove the enclosing `Ok` and `?` operator
|
130 ~ SshConnection::new(
131 | username,
132 | &self.private_key,
133 | self.ssh_port,
134 ~ )
|
|
|
[clippy] goldboot/src/builder/qemu.rs#L170:
goldboot/src/builder/qemu.rs#L170
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> goldboot/src/builder/qemu.rs:170:1
|
170 | impl Into<Vec<String>> 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/rust-1.91.0/index.html#from_over_into
help: replace the `Into` implementation with `From<builder::qemu::QemuArgs>`
|
170 ~ impl From<QemuArgs> for Vec<String> {
171 ~ fn from(val: QemuArgs) -> Self {
172 | let mut cmdline = vec![
173 | String::from("-name"),
174 ~ val.name.clone(),
175 | String::from("-bios"),
176 ~ val.bios.clone(),
177 | String::from("-m"),
178 ~ val.memory.clone(),
179 | String::from("-boot"),
180 ~ val.boot.clone(),
181 | String::from("-display"),
182 ~ val.display.clone(),
183 | String::from("-smp"),
184 ~ val.smp.clone(),
185 | String::from("-machine"),
186 ~ val.machine.clone(),
187 | String::from("-rtc"),
...
190 |
191 ~ if let Some(cpu) = &val.cpu {
192 | cmdline.push(String::from("-cpu"));
...
195 |
196 ~ if let Some(smbios) = &val.smbios {
197 | cmdline.push(String::from("-smbios"));
...
200 |
201 ~ for usbdevice in &val.usbdevice {
202 | cmdline.push(String::from("-usbdevice"));
...
205 |
206 ~ for global in &val.global {
207 | cmdline.push(String::from("-global"));
...
210 |
211 ~ for drive in &val.drive {
212 | cmdline.push(String::from("-drive"));
...
215 |
216 ~ for netdev in &val.netdev {
217 | cmdline.push(String::from("-netdev"));
...
220 |
221 ~ for vnc in &val.vnc {
222 | cmdline.push(String::from("-vnc"));
...
225 |
226 ~ for blockdev in &val.blockdev {
227 | cmdline.push(String::from("-blockdev"));
...
230 |
231 ~ for chardev in &val.chardev {
232 | cmdline.push(String::from("-chardev"));
...
235 |
236 ~ for tpmdev in &val.tpmdev {
237 | cmdline.push(String::from("-tpmdev"));
...
240 |
241 ~ for device in &val.device {
242 | cmdline.push(String::from("-device"));
...
246 | cmdline.push(String::from("-vga"));
247 ~ cmdline.push(val.vga.to_string());
|
|
|
[clippy] goldboot/src/builder/qemu.rs#L380:
goldboot/src/builder/qemu.rs#L380
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:380:18
|
380 | .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/rust-1.91.0/index.html#suspicious_open_options
= note: `#[warn(clippy::suspicious_open_options)]` on by default
|
|
[clippy] goldboot/src/builder/qemu.rs#L392:
goldboot/src/builder/qemu.rs#L392
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:392:18
|
392 | .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/rust-1.91.0/index.html#suspicious_open_options
|
|
[clippy] goldboot/src/builder/qemu.rs#L436:
goldboot/src/builder/qemu.rs#L436
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:436:18
|
436 | .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/rust-1.91.0/index.html#suspicious_open_options
|
|
[clippy] goldboot/src/builder/qemu.rs#L451:
goldboot/src/builder/qemu.rs#L451
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:451:18
|
451 | .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/rust-1.91.0/index.html#suspicious_open_options
|
|
[clippy] goldboot/src/builder/qemu.rs#L482:
goldboot/src/builder/qemu.rs#L482
warning: enclosing `Ok` and `?` operator are unneeded
--> goldboot/src/builder/qemu.rs:482:9
|
482 | / Ok(self.drive_files(HashMap::from([
483 | | ("sshdog".to_string(), sshdog),
484 | | ("host_key".to_string(), host_key),
485 | | ("public_key".to_string(), public_key),
486 | | ]))?)
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_question_mark
help: remove the enclosing `Ok` and `?` operator
|
482 ~ self.drive_files(HashMap::from([
483 | ("sshdog".to_string(), sshdog),
484 | ("host_key".to_string(), host_key),
485 | ("public_key".to_string(), public_key),
486 ~ ]))
|
|
|
[clippy] goldboot/src/builder/qemu.rs#L505:
goldboot/src/builder/qemu.rs#L505
warning: length comparison to zero
--> goldboot/src/builder/qemu.rs:505:30
|
505 | 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/rust-1.91.0/index.html#len_zero
|
|
[clippy] goldboot/src/builder/sources.rs#L21:
goldboot/src/builder/sources.rs#L21
warning: method `default` can be confused for the standard trait method `std::default::Default::default`
--> goldboot/src/builder/sources.rs:21:5
|
21 | / pub fn default() -> Result<Self> {
22 | | let directory = if cfg!(target_os = "linux") {
23 | | PathBuf::from(format!(
24 | | "/home/{}/.cache/goldboot/sources",
... |
43 | | Ok(Self { directory })
44 | | }
| |_____^
|
= 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/rust-1.91.0/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
|
[clippy] goldboot/src/builder/sources.rs#L53:
goldboot/src/builder/sources.rs#L53
warning: this boolean expression can be simplified
--> goldboot/src/builder/sources.rs:53:20
|
53 | if !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
| ____________________^
54 | | .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/rust-1.91.0/index.html#nonminimal_bool
|
|
[clippy] goldboot/src/builder/sources.rs#L52:
goldboot/src/builder/sources.rs#L52
warning: this `if` statement can be collapsed
--> goldboot/src/builder/sources.rs:52:13
|
52 | / if path.is_file() {
53 | | if !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
54 | | .is_ok()
... |
59 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#collapsible_if
help: collapse nested if block
|
52 ~ if path.is_file()
53 ~ && !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
54 | .is_ok()
...
57 | std::fs::remove_file(&path)?;
58 ~ }
|
|
|
[clippy] goldboot/src/builder/ssh.rs#L29:
goldboot/src/builder/ssh.rs#L29
warning: the borrowed expression implements the required traits
--> goldboot/src/builder/ssh.rs:29:9
|
29 | &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/rust-1.91.0/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
|
[clippy] goldboot/src/builder/ssh.rs#L56:
goldboot/src/builder/ssh.rs#L56
warning: this creates an owned instance just for comparison
--> goldboot/src/builder/ssh.rs:56:12
|
56 | if entry
| ____________^
57 | | .path()?
58 | | .file_stem()
59 | | .unwrap()
60 | | .to_string_lossy()
61 | | .to_string()
| |________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#cmp_owned
= note: `#[warn(clippy::cmp_owned)]` on by default
help: try
|
56 ~ if entry
57 + .path()?
58 + .file_stem()
59 + .unwrap()
60 + .to_string_lossy()
|
|
|
[clippy] goldboot/src/builder/ssh.rs#L110:
goldboot/src/builder/ssh.rs#L110
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> goldboot/src/builder/ssh.rs:110:45
|
110 | fn connect(username: &str, private_key: &PathBuf, port: u16) -> Result<Session> {
| ^^^^^^^^ help: change this to: `&Path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
|
[clippy] goldboot/src/builder/ssh.rs#L181:
goldboot/src/builder/ssh.rs#L181
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/ssh.rs:181:28
|
181 | channel.setenv(&var, &val)?;
| ^^^^ help: change this to: `var`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/ssh.rs#L181:
goldboot/src/builder/ssh.rs#L181
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/ssh.rs:181:34
|
181 | channel.setenv(&var, &val)?;
| ^^^^ help: change this to: `val`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/vnc.rs#L29:
goldboot/src/builder/vnc.rs#L29
warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
--> goldboot/src/builder/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/rust-1.91.0/index.html#toplevel_ref_arg
= note: `#[warn(clippy::toplevel_ref_arg)]` on by default
|
|
[clippy] goldboot/src/builder/vnc.rs#L163:
goldboot/src/builder/vnc.rs#L163
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> goldboot/src/builder/vnc.rs:163:13
|
163 | / match event {
164 | | Event::Resize(width, height) => {
165 | | self.width = width;
166 | | self.height = height;
167 | | }
168 | | _ => {}
169 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
163 ~ if let Event::Resize(width, height) = event {
164 + self.width = width;
165 + self.height = height;
166 + }
|
|
|
[clippy] goldboot/src/builder/vnc.rs#L238:
goldboot/src/builder/vnc.rs#L238
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/vnc.rs:238:42
|
238 | 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/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/vnc.rs#L325:
goldboot/src/builder/vnc.rs#L325
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/vnc.rs:325:58
|
325 | ... screenshot.write_png(&Path::new("screenshots/frozen.png"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new("screenshots/frozen.png")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/vnc.rs#L379:
goldboot/src/builder/vnc.rs#L379
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/vnc.rs:379:36
|
379 | .write_png(&Path::new(&format!("screenshots/{cmd_number}.png")))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&format!("screenshots/{cmd_number}.png"))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/mod.rs#L136:
goldboot/src/builder/mod.rs#L136
warning: useless conversion to the same type: `std::path::PathBuf`
--> goldboot/src/builder/mod.rs:136:38
|
136 | self.ovmf_path = PathBuf::from(path);
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `PathBuf::from()`: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
|
[clippy] goldboot/src/builder/mod.rs#L163:
goldboot/src/builder/mod.rs#L163
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/mod.rs:163:35
|
163 | element.build(&self)?;
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/mod.rs#L175:
goldboot/src/builder/mod.rs#L175
warning: redundant pattern matching, consider using `is_none()`
--> goldboot/src/builder/mod.rs:175:24
|
175 | if let None = output {
| -------^^^^--------- help: try: `if output.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
|
|
[clippy] goldboot/src/library.rs#L26:
goldboot/src/library.rs#L26
warning: this `if` has identical blocks
--> goldboot/src/library.rs:26:54
|
26 | let directory = if cfg!(target_os = "linux") {
| ______________________________________________________^
27 | | PathBuf::from("/var/lib/goldboot/images")
28 | | } else if cfg!(target_os = "macos") {
| |_________^
|
note: same as this
--> goldboot/src/library.rs:28:45
|
28 | } else if cfg!(target_os = "macos") {
| _____________________________________________^
29 | | PathBuf::from("/var/lib/goldboot/images")
30 | | } else {
| |_________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#if_same_then_else
= note: `#[warn(clippy::if_same_then_else)]` on by default
|
|
[clippy] goldboot/src/library.rs#L120:
goldboot/src/library.rs#L120
warning: enclosing `Ok` and `?` operator are unneeded
--> goldboot/src/library.rs:120:9
|
120 | / Ok(Self::find_all()?
121 | | .into_iter()
122 | | .find(|image| image.id == image_id || image.id[0..12] == image_id[0..12])
123 | | .ok_or_else(|| anyhow!("Image not found"))?)
| |________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#needless_question_mark
help: remove the enclosing `Ok` and `?` operator
|
120 ~ Self::find_all()?
121 | .into_iter()
122 | .find(|image| image.id == image_id || image.id[0..12] == image_id[0..12])
123 ~ .ok_or_else(|| anyhow!("Image not found"))
|
|
|
[clippy] goldboot-image/src/lib.rs#L471:
goldboot-image/src/lib.rs#L471
warning: empty line after doc comment
--> goldboot-image/src/lib.rs:468:5
|
468 | / /// TODO write backup GPT header
469 | |
| |_^
470 | /// Write the image contents out to disk.
471 | pub fn write<F: Fn(u64, u64) -> ()>(&self, dest: impl AsRef<Path>, progress: F) -> Result<()> {
| ------------ the comment documents this function
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#empty_line_after_doc_comments
= note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
= help: if the empty line is unintentional, remove it
help: if the documentation should include the empty line include it in the comment
|
469 | ///
|
|
|
[clippy] goldboot-image/src/lib.rs#L1:
goldboot-image/src/lib.rs#L1
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/beta/index.html#empty_docs
= note: `#[warn(clippy::empty_docs)]` on by default
|
|
[clippy] goldboot-image/src/qcow/mod.rs#L68:
goldboot-image/src/qcow/mod.rs#L68
warning: unnecessary use of `to_string`
--> goldboot-image/src/qcow/mod.rs:68:17
|
68 | &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/beta/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L422:
goldboot-image/src/lib.rs#L422
warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:422:28
|
422 | compute_id(&path).unwrap()
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L425:
goldboot-image/src/lib.rs#L425
warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:425:24
|
425 | compute_id(&path).unwrap()
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrows_for_generic_args
|
|
[clippy] goldboot-image/src/lib.rs#L443:
goldboot-image/src/lib.rs#L443
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/beta/index.html#needless_borrows_for_generic_args
|
|
[clippy] goldboot-image/src/lib.rs#L453:
goldboot-image/src/lib.rs#L453
warning: the borrowed expression implements the required traits
--> goldboot-image/src/lib.rs:453:46
|
453 | file_size: std::fs::metadata(&path)?.len(),
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrows_for_generic_args
|
|
[clippy] goldboot-image/src/lib.rs#L471:
goldboot-image/src/lib.rs#L471
warning: unneeded unit return type
--> goldboot-image/src/lib.rs:471:33
|
471 | pub fn write<F: Fn(u64, u64) -> ()>(&self, dest: impl AsRef<Path>, progress: F) -> Result<()> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unused_unit
= note: `#[warn(clippy::unused_unit)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L486:
goldboot-image/src/lib.rs#L486
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot-image/src/lib.rs:486:14
|
486 | .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/beta/index.html#suspicious_open_options
= note: `#[warn(clippy::suspicious_open_options)]` on by default
|
|
[clippy] goldboot-image/src/lib.rs#L504:
goldboot-image/src/lib.rs#L504
warning: the loop variable `i` is used to index `digest_table`
--> goldboot-image/src/lib.rs:504:18
|
504 | for i in 0..protected_header.cluster_count as usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
504 - for i in 0..protected_header.cluster_count as usize {
504 + for (i, <item>) in digest_table.iter().enumerate().take(protected_header.cluster_count as usize) {
|
|
|
[clippy] goldboot-image/src/lib.rs#L569:
goldboot-image/src/lib.rs#L569
warning: unneeded unit return type
--> goldboot-image/src/lib.rs:569:37
|
569 | pub fn from_qcow<F: Fn(u64, u64) -> ()>(
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unused_unit
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L3:
goldboot/src/cli/cmd/init.rs#L3
warning: unused imports: `Input` and `Password`
--> goldboot/src/cli/cmd/init.rs:3:26
|
3 | use dialoguer::{Confirm, Input, Password, Select, theme::ColorfulTheme};
| ^^^^^ ^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] goldboot/src/cli/cmd/liveusb.rs#L6:
goldboot/src/cli/cmd/liveusb.rs#L6
warning: unused import: `builder::os::Os`
--> goldboot/src/cli/cmd/liveusb.rs:6:41
|
6 | use crate::{cli::progress::ProgressBar, builder::os::Os, library::ImageLibrary};
| ^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/config.rs#L5:
goldboot/src/config.rs#L5
warning: unused imports: `IntoPyDict`, `PyModule`, and `ffi::c_str`
--> goldboot/src/config.rs:5:5
|
5 | ffi::c_str,
| ^^^^^^^^^^
6 | prelude::*,
7 | types::{IntoPyDict, PyModule},
| ^^^^^^^^^^ ^^^^^^^^
|
|
[clippy] goldboot/src/config.rs#L15:
goldboot/src/config.rs#L15
warning: unused imports: `thread` and `time::SystemTime`
--> goldboot/src/config.rs:15:5
|
15 | thread,
| ^^^^^^
16 | time::SystemTime,
| ^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/config.rs#L20:
goldboot/src/config.rs#L20
warning: unused import: `Builder`
--> goldboot/src/config.rs:20:22
|
20 | use crate::builder::{Builder, os::Os};
| ^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L2:
goldboot/src/builder/mod.rs#L2
warning: unused import: `fabricators::Fabricator`
--> goldboot/src/builder/mod.rs:2:12
|
2 | use self::{fabricators::Fabricator, os::Os};
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L8:
goldboot/src/builder/mod.rs#L8
warning: unused import: `anyhow`
--> goldboot/src/builder/mod.rs:8:22
|
8 | use anyhow::{Result, anyhow, bail};
| ^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L9:
goldboot/src/builder/mod.rs#L9
warning: unused import: `byte_unit::Byte`
--> goldboot/src/builder/mod.rs:9:5
|
9 | use byte_unit::Byte;
| ^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L11:
goldboot/src/builder/mod.rs#L11
warning: unused import: `goldboot_image::ElementHeader`
--> goldboot/src/builder/mod.rs:11:5
|
11 | use goldboot_image::ElementHeader;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L14:
goldboot/src/builder/mod.rs#L14
warning: unused imports: `Deserialize` and `Serialize`
--> goldboot/src/builder/mod.rs:14:13
|
14 | use serde::{Deserialize, Serialize};
| ^^^^^^^^^^^ ^^^^^^^^^
|
|
[clippy] goldboot/src/builder/mod.rs#L16:
goldboot/src/builder/mod.rs#L16
warning: unused imports: `Path` and `thread`
--> goldboot/src/builder/mod.rs:16:12
|
16 | path::{Path, PathBuf},
| ^^^^
17 | thread,
| ^^^^^^
|
|
[clippy] goldboot/src/builder/os/alpine_linux/mod.rs#L2:
goldboot/src/builder/os/alpine_linux/mod.rs#L2
warning: unused import: `goldboot_image::ImageArch`
--> goldboot/src/builder/os/alpine_linux/mod.rs:2:5
|
2 | use goldboot_image::ImageArch;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/vnc.rs#L408:
goldboot/src/builder/vnc.rs#L408
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:408:17
|
408 | crate::builder::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/beta/index.html#crate_in_macro_def
= note: `#[warn(clippy::crate_in_macro_def)]` on by default
|
|
[clippy] goldboot/src/builder/vnc.rs#L425:
goldboot/src/builder/vnc.rs#L425
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:425:17
|
425 | crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L435:
goldboot/src/builder/vnc.rs#L435
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:435:17
|
435 | crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L445:
goldboot/src/builder/vnc.rs#L445
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:445:17
|
445 | crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L461:
goldboot/src/builder/vnc.rs#L461
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:461:18
|
461 | vec![crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L468:
goldboot/src/builder/vnc.rs#L468
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:468:18
|
468 | vec![crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L475:
goldboot/src/builder/vnc.rs#L475
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:475:18
|
475 | vec![crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L489:
goldboot/src/builder/vnc.rs#L489
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:489:17
|
489 | crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/builder/vnc.rs#L499:
goldboot/src/builder/vnc.rs#L499
warning: `crate` references the macro call's crate
--> goldboot/src/builder/vnc.rs:499:17
|
499 | crate::builder::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/beta/index.html#crate_in_macro_def
|
|
[clippy] goldboot/src/library.rs#L1:
goldboot/src/library.rs#L1
warning: unused import: `builder::os::Os`
--> goldboot/src/library.rs:1:41
|
1 | use crate::{cli::progress::ProgressBar, builder::os::Os};
| ^^^^^^^^^^^^^^^
|
|
[clippy] /rustc/f3f12444a017add0468f683f3a10656d29438a05/library/core/src/macros/mod.rs#L879:
/rustc/f3f12444a017add0468f683f3a10656d29438a05/library/core/src/macros/mod.rs#L879
warning: unreachable expression
--> goldboot/src/cli/cmd/image.rs:18:21
|
18 | / println!(
19 | | "{:15} {:12} {:31} {:12} {}",
20 | | todo!(),
| | ------- any code following this expression is unreachable
21 | | image.primary_header.size.bytes().to_string(),
... |
26 | | "TODO",
27 | | );
| |_____________________^ unreachable expression
|
= note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default
= note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L23:
goldboot/src/cli/cmd/image.rs#L23
warning: use of deprecated method `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> goldboot/src/cli/cmd/image.rs:23:30
|
23 | ... .timestamp(image.primary_header.timestamp as i64, 0)
| ^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
|
|
[clippy] goldboot/src/builder/qemu.rs#L308:
goldboot/src/builder/qemu.rs#L308
warning: unreachable expression
--> goldboot/src/builder/qemu.rs:308:23
|
307 | memory: todo!(),
| ------- any code following this expression is unreachable
308 | name: String::from("goldboot"),
| ^^^^^^^^^^^^^^^^^^^^^^^^ unreachable expression
|
|
[clippy] goldboot/src/registry/api/image.rs#L28:
goldboot/src/registry/api/image.rs#L28
warning: unreachable expression
--> goldboot/src/registry/api/image.rs:28:19
|
27 | name: todo!(),
| ------- any code following this expression is unreachable
28 | arch: value.primary_header.arch,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable expression
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L2:
goldboot/src/builder/os/arch_linux/mod.rs#L2
warning: unused import: `crate::builder::fabricators::Fabricate`
--> goldboot/src/builder/os/arch_linux/mod.rs:2:5
|
2 | use crate::builder::fabricators::Fabricate;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/windows_10/mod.rs#L17:
goldboot/src/builder/os/windows_10/mod.rs#L17
warning: unused import: `cli::prompt::Prompt`
--> goldboot/src/builder/os/windows_10/mod.rs:17:5
|
17 | cli::prompt::Prompt,
| ^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/windows_11/mod.rs#L16:
goldboot/src/builder/os/windows_11/mod.rs#L16
warning: unused import: `cli::prompt::Prompt`
--> goldboot/src/builder/os/windows_11/mod.rs:16:5
|
16 | cli::prompt::Prompt,
| ^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L17:
goldboot/src/cli/cmd/image.rs#L17
warning: unused variable: `image`
--> goldboot/src/cli/cmd/image.rs:17:21
|
17 | for image in images {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_image`
|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L38:
goldboot/src/cli/cmd/init.rs#L38
warning: unused variable: `name`
--> goldboot/src/cli/cmd/init.rs:38:13
|
38 | name,
| ^^^^ help: try ignoring the field: `name: _`
|
|
[clippy] goldboot/src/cli/cmd/liveusb.rs#L12:
goldboot/src/cli/cmd/liveusb.rs#L12
warning: unused variable: `include`
--> goldboot/src/cli/cmd/liveusb.rs:12:13
|
12 | include,
| ^^^^^^^ help: try ignoring the field: `include: _`
|
|
[clippy] goldboot/src/builder/options/arch.rs#L10:
goldboot/src/builder/options/arch.rs#L10
warning: unused variable: `builder`
--> goldboot/src/builder/options/arch.rs:10:26
|
10 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/options/hostname.rs#L30:
goldboot/src/builder/options/hostname.rs#L30
warning: unused variable: `builder`
--> goldboot/src/builder/options/hostname.rs:30:26
|
30 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/options/size.rs#L18:
goldboot/src/builder/options/size.rs#L18
warning: unused variable: `builder`
--> goldboot/src/builder/options/size.rs:18:26
|
18 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/os/debian/mod.rs#L106:
goldboot/src/builder/os/debian/mod.rs#L106
warning: unused variable: `builder`
--> goldboot/src/builder/os/debian/mod.rs:106:26
|
106 | fn prompt(&mut self, builder: &Builder) -> Result<()> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
|
|
[clippy] goldboot/src/builder/qemu.rs#L269:
goldboot/src/builder/qemu.rs#L269
warning: unused variable: `ssh_port`
--> goldboot/src/builder/qemu.rs:269:13
|
269 | let ssh_port = rand::rng().random_range(10000..11000);
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ssh_port`
|
|
[clippy] goldboot/src/builder/qemu.rs#L270:
goldboot/src/builder/qemu.rs#L270
warning: unused variable: `ssh_private_key`
--> goldboot/src/builder/qemu.rs:270:13
|
270 | let ssh_private_key = crate::builder::ssh::generate_key(worker.tmp.path()).unwrap();
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ssh_private_key`
|
|
[clippy] goldboot/src/builder/qemu.rs#L271:
goldboot/src/builder/qemu.rs#L271
warning: unused variable: `ssh_host_key`
--> goldboot/src/builder/qemu.rs:271:13
|
271 | let ssh_host_key = crate::builder::ssh::generate_key(worker.tmp.path()).unwrap();
| ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ssh_host_key`
|
|
[clippy] goldboot/src/builder/ssh.rs#L230:
goldboot/src/builder/ssh.rs#L230
warning: unused variable: `session`
--> goldboot/src/builder/ssh.rs:230:13
|
230 | fn query_os(session: &ssh2::Session) -> Result<OsCategory> {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_session`
|
|
[clippy] goldboot/src/builder/mod.rs#L83:
goldboot/src/builder/mod.rs#L83
warning: unused variable: `element`
--> goldboot/src/builder/mod.rs:83:18
|
83 | Some(element) => {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_element`
|
|
[clippy] goldboot/src/builder/mod.rs#L107:
goldboot/src/builder/mod.rs#L107
warning: unused variable: `path`
--> goldboot/src/builder/mod.rs:107:17
|
107 | path,
| ^^^^ help: try ignoring the field: `path: _`
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L40:
goldboot/src/builder/os/arch_linux/mod.rs#L40
warning: type `builder::os::arch_linux::ArchLinuxPackages` is more private than the item `builder::os::arch_linux::ArchLinux::packages`
--> goldboot/src/builder/os/arch_linux/mod.rs:40:5
|
40 | pub packages: Option<ArchLinuxPackages>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `builder::os::arch_linux::ArchLinux::packages` is reachable at visibility `pub`
|
note: but type `builder::os::arch_linux::ArchLinuxPackages` is only usable at visibility `pub(self)`
--> goldboot/src/builder/os/arch_linux/mod.rs:181:1
|
181 | struct ArchLinuxPackages(Vec<String>);
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
|
|
[clippy] goldboot/src/builder/os/nix/mod.rs#L35:
goldboot/src/builder/os/nix/mod.rs#L35
warning: type `builder::os::nix::ConfigurationPath` is more private than the item `builder::os::nix::Nix::configuration`
--> goldboot/src/builder/os/nix/mod.rs:35:5
|
35 | pub configuration: ConfigurationPath,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `builder::os::nix::Nix::configuration` is reachable at visibility `pub`
|
note: but type `builder::os::nix::ConfigurationPath` is only usable at visibility `pub(self)`
--> goldboot/src/builder/os/nix/mod.rs:82:1
|
82 | struct ConfigurationPath(PathBuf);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/nix/mod.rs#L38:
goldboot/src/builder/os/nix/mod.rs#L38
warning: type `builder::os::nix::ConfigurationPath` is more private than the item `builder::os::nix::Nix::hardware_configuration`
--> goldboot/src/builder/os/nix/mod.rs:38:5
|
38 | pub hardware_configuration: Option<ConfigurationPath>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `builder::os::nix::Nix::hardware_configuration` is reachable at visibility `pub`
|
note: but type `builder::os::nix::ConfigurationPath` is only usable at visibility `pub(self)`
--> goldboot/src/builder/os/nix/mod.rs:82:1
|
82 | struct ConfigurationPath(PathBuf);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L155:
goldboot/src/builder/os/arch_linux/mod.rs#L155
warning: function `fetch_latest_iso` is never used
--> goldboot/src/builder/os/arch_linux/mod.rs:155:4
|
155 | fn fetch_latest_iso() -> Result<Iso> {
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] goldboot/src/cli/cmd/deploy.rs#L36:
goldboot/src/cli/cmd/deploy.rs#L36
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()
... |
44 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
36 ~ if Path::new(&output).exists() && !confirm
37 ~ && !Confirm::with_theme(&theme)
38 | .with_prompt("Do you want to continue?")
...
42 | std::process::exit(0);
43 ~ }
|
|
|
[clippy] goldboot/src/cli/cmd/image.rs#L26:
goldboot/src/cli/cmd/image.rs#L26
warning: literal with an empty format string
--> goldboot/src/cli/cmd/image.rs:26:25
|
26 | "TODO",
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#print_literal
= note: `#[warn(clippy::print_literal)]` on by default
help: try
|
19 ~ "{:15} {:12} {:31} {:12} TODO",
20 | todo!(),
...
24 | .to_rfc2822(),
25 ~ &image.id[0..12],
|
|
|
[clippy] /rustc/f3f12444a017add0468f683f3a10656d29438a05/library/core/src/macros/mod.rs#L879:
/rustc/f3f12444a017add0468f683f3a10656d29438a05/library/core/src/macros/mod.rs#L879
warning: sub-expression diverges
--> goldboot/src/cli/cmd/image.rs:20:25
|
20 | todo!(),
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#diverging_sub_expression
= note: `#[warn(clippy::diverging_sub_expression)]` on by default
= note: this warning originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L19:
goldboot/src/cli/cmd/init.rs#L19
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/beta/index.html#print_literal
help: try
|
19 - println!("{}", "");
19 + println!("");
|
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L23:
goldboot/src/cli/cmd/init.rs#L23
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/beta/index.html#print_literal
help: try
|
23 - println!("{}", "");
23 + println!("");
|
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L46:
goldboot/src/cli/cmd/init.rs#L46
warning: length comparison to zero
--> goldboot/src/cli/cmd/init.rs:46:16
|
46 | if builder.elements.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `builder.elements.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
|
[clippy] goldboot/src/cli/cmd/init.rs#L101:
goldboot/src/cli/cmd/init.rs#L101
warning: length comparison to zero
--> goldboot/src/cli/cmd/init.rs:101:38
|
101 | .filter(|os| builder.elements.len() == 0 || os.alloy())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `builder.elements.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#len_zero
|
|
[clippy] goldboot/src/cli/cmd/liveusb.rs#L35:
goldboot/src/cli/cmd/liveusb.rs#L35
warning: this `if` statement can be collapsed
--> goldboot/src/cli/cmd/liveusb.rs:35:13
|
35 | / if !confirm {
36 | | if !Confirm::with_theme(&theme)
37 | | .with_prompt(format!("Do you want to overwrite: {}?", dest))
38 | | .interact()
... |
43 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#collapsible_if
help: collapse nested if block
|
35 ~ if !confirm
36 ~ && !Confirm::with_theme(&theme)
37 | .with_prompt(format!("Do you want to overwrite: {}?", dest))
...
41 | return ExitCode::FAILURE;
42 ~ }
|
|
|
[clippy] goldboot/src/cli/progress.rs#L53:
goldboot/src/cli/progress.rs#L53
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/beta/index.html#new_ret_no_self
= note: `#[warn(clippy::new_ret_no_self)]` on by default
|
|
[clippy] goldboot/src/cli/progress.rs#L100:
goldboot/src/cli/progress.rs#L100
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;
... |
112 | | }
| |_________^ help: try: `while let Ok(size) = reader.read(&mut buffer) { .. }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#while_let_loop
= note: `#[warn(clippy::while_let_loop)]` on by default
|
|
[clippy] goldboot/src/cli/progress.rs#L119:
goldboot/src/cli/progress.rs#L119
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/beta/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
|
[clippy] goldboot/src/config.rs#L31:
goldboot/src/config.rs#L31
warning: redundant closure
--> goldboot/src/config.rs:31:69
|
31 | let items: Result<Vec<String>, _> = elements.iter().map(|os| format_os(os)).collect();
| ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `format_os`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
|
[clippy] goldboot/src/config.rs#L322:
goldboot/src/config.rs#L322
warning: large size difference between variants
--> goldboot/src/config.rs:322:1
|
322 | / enum SingleOrMultiple {
323 | | Single(Os),
| | ---------- the largest variant contains at least 248 bytes
324 | | Multiple(Vec<Os>),
| | ----------------- the second-largest variant contains at least 24 bytes
325 | | }
| |_^ the entire enum is at least 248 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum
|
323 - Single(Os),
323 + Single(Box<Os>),
|
|
|
[clippy] goldboot/src/builder/fabricators/ansible.rs#L28:
goldboot/src/builder/fabricators/ansible.rs#L28
warning: single argument that looks like it should be multiple arguments
--> goldboot/src/builder/fabricators/ansible.rs:28:18
|
28 | .arg("-o StrictHostKeyChecking=no")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#suspicious_command_arg_space
= note: `#[warn(clippy::suspicious_command_arg_space)]` on by default
help: consider splitting the argument
|
28 - .arg("-o StrictHostKeyChecking=no")
28 + .args(["-o", "StrictHostKeyChecking=no"])
|
|
|
[clippy] goldboot/src/builder/fabricators/ansible.rs#L66:
goldboot/src/builder/fabricators/ansible.rs#L66
warning: this `if` statement can be collapsed
--> goldboot/src/builder/fabricators/ansible.rs:66:9
|
66 | / if !Path::new(&self.playbook).exists() {
67 | | if !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
68 | | .with_prompt("The path does not exist. Add anyway?")
69 | | .interact()?
... |
73 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#collapsible_if
help: collapse nested if block
|
66 ~ if !Path::new(&self.playbook).exists()
67 ~ && !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
68 | .with_prompt("The path does not exist. Add anyway?")
...
71 | bail!("The playbook did not exist");
72 ~ }
|
|
|
[clippy] goldboot/src/builder/fabricators/exe.rs#L35:
goldboot/src/builder/fabricators/exe.rs#L35
warning: this `if` statement can be collapsed
--> goldboot/src/builder/fabricators/exe.rs:35:9
|
35 | / if !Path::new(&self.path).exists() {
36 | | if !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
37 | | .with_prompt("The path does not exist. Add anyway?")
38 | | .interact()?
... |
42 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#collapsible_if
help: collapse nested if block
|
35 ~ if !Path::new(&self.path).exists()
36 ~ && !dialoguer::Confirm::with_theme(&crate::cli::cmd::init::theme())
37 | .with_prompt("The path does not exist. Add anyway?")
...
40 | bail!("The playbook did not exist");
41 ~ }
|
|
|
[clippy] goldboot/src/builder/http.rs#L20:
goldboot/src/builder/http.rs#L20
warning: methods called `new` usually return `Self`
--> goldboot/src/builder/http.rs:20:5
|
20 | / pub fn new() -> Result<HttpServerBuilder> {
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/beta/index.html#new_ret_no_self
|
|
[clippy] goldboot/src/builder/options/size.rs#L51:
goldboot/src/builder/options/size.rs#L51
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> goldboot/src/builder/options/size.rs:51:1
|
51 | impl Into<u64> for Size {
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= 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/beta/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<builder::options::size::Size>`
|
51 ~ impl From<Size> for u64 {
52 ~ fn from(val: Size) -> Self {
53 | // Assume Size was validated previously
54 ~ val.0
|
|
|
[clippy] goldboot/src/builder/os/alpine_linux/mod.rs#L39:
goldboot/src/builder/os/alpine_linux/mod.rs#L39
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/alpine_linux/mod.rs:39:41
|
39 | 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/beta/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L51:
goldboot/src/builder/os/arch_linux/mod.rs#L51
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/arch_linux/mod.rs:51:41
|
51 | 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/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L156:
goldboot/src/builder/os/arch_linux/mod.rs#L156
warning: useless use of `format!`
--> goldboot/src/builder/os/arch_linux/mod.rs:156:37
|
156 | let rs = reqwest::blocking::get(format!(
| _____________________________________^
157 | | "http://mirrors.edge.kernel.org/archlinux/iso/latest/sha256sums.txt"
158 | | ))?;
| |_____^ 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/beta/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
[clippy] goldboot/src/builder/os/arch_linux/mod.rs#L160:
goldboot/src/builder/os/arch_linux/mod.rs#L160
warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
--> goldboot/src/builder/os/arch_linux/mod.rs:160:48
|
160 | 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/builder/os/arch_linux/mod.rs:160:21
|
160 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#lines_filter_map_ok
= note: `#[warn(clippy::lines_filter_map_ok)]` on by default
|
|
[clippy] goldboot/src/builder/os/debian/mod.rs#L48:
goldboot/src/builder/os/debian/mod.rs#L48
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/debian/mod.rs:48:41
|
48 | 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/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/debian/mod.rs#L137:
goldboot/src/builder/os/debian/mod.rs#L137
warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
--> goldboot/src/builder/os/debian/mod.rs:137:48
|
137 | 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/builder/os/debian/mod.rs:137:21
|
137 | for line in BufReader::new(rs).lines().filter_map(|result| result.ok()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#lines_filter_map_ok
|
|
[clippy] goldboot/src/builder/os/nix/mod.rs#L49:
goldboot/src/builder/os/nix/mod.rs#L49
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/nix/mod.rs:49:41
|
49 | 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/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/windows_10/mod.rs#L146:
goldboot/src/builder/os/windows_10/mod.rs#L146
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/windows_10/mod.rs:146:41
|
146 | 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/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/os/windows_11/mod.rs#L158:
goldboot/src/builder/os/windows_11/mod.rs#L158
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/os/windows_11/mod.rs:158:41
|
158 | 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/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/qemu.rs#L130:
goldboot/src/builder/qemu.rs#L130
warning: enclosing `Ok` and `?` operator are unneeded
--> goldboot/src/builder/qemu.rs:130:9
|
130 | / Ok(SshConnection::new(
131 | | username,
132 | | &self.private_key,
133 | | self.ssh_port,
134 | | )?)
| |___________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
help: remove the enclosing `Ok` and `?` operator
|
130 ~ SshConnection::new(
131 | username,
132 | &self.private_key,
133 | self.ssh_port,
134 ~ )
|
|
|
[clippy] goldboot/src/builder/qemu.rs#L170:
goldboot/src/builder/qemu.rs#L170
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> goldboot/src/builder/qemu.rs:170:1
|
170 | impl Into<Vec<String>> 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/beta/index.html#from_over_into
help: replace the `Into` implementation with `From<builder::qemu::QemuArgs>`
|
170 ~ impl From<QemuArgs> for Vec<String> {
171 ~ fn from(val: QemuArgs) -> Self {
172 | let mut cmdline = vec![
173 | String::from("-name"),
174 ~ val.name.clone(),
175 | String::from("-bios"),
176 ~ val.bios.clone(),
177 | String::from("-m"),
178 ~ val.memory.clone(),
179 | String::from("-boot"),
180 ~ val.boot.clone(),
181 | String::from("-display"),
182 ~ val.display.clone(),
183 | String::from("-smp"),
184 ~ val.smp.clone(),
185 | String::from("-machine"),
186 ~ val.machine.clone(),
187 | String::from("-rtc"),
...
190 |
191 ~ if let Some(cpu) = &val.cpu {
192 | cmdline.push(String::from("-cpu"));
...
195 |
196 ~ if let Some(smbios) = &val.smbios {
197 | cmdline.push(String::from("-smbios"));
...
200 |
201 ~ for usbdevice in &val.usbdevice {
202 | cmdline.push(String::from("-usbdevice"));
...
205 |
206 ~ for global in &val.global {
207 | cmdline.push(String::from("-global"));
...
210 |
211 ~ for drive in &val.drive {
212 | cmdline.push(String::from("-drive"));
...
215 |
216 ~ for netdev in &val.netdev {
217 | cmdline.push(String::from("-netdev"));
...
220 |
221 ~ for vnc in &val.vnc {
222 | cmdline.push(String::from("-vnc"));
...
225 |
226 ~ for blockdev in &val.blockdev {
227 | cmdline.push(String::from("-blockdev"));
...
230 |
231 ~ for chardev in &val.chardev {
232 | cmdline.push(String::from("-chardev"));
...
235 |
236 ~ for tpmdev in &val.tpmdev {
237 | cmdline.push(String::from("-tpmdev"));
...
240 |
241 ~ for device in &val.device {
242 | cmdline.push(String::from("-device"));
...
246 | cmdline.push(String::from("-vga"));
247 ~ cmdline.push(val.vga.to_string());
|
|
|
[clippy] goldboot/src/builder/qemu.rs#L380:
goldboot/src/builder/qemu.rs#L380
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:380:18
|
380 | .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/beta/index.html#suspicious_open_options
= note: `#[warn(clippy::suspicious_open_options)]` on by default
|
|
[clippy] goldboot/src/builder/qemu.rs#L392:
goldboot/src/builder/qemu.rs#L392
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:392:18
|
392 | .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/beta/index.html#suspicious_open_options
|
|
[clippy] goldboot/src/builder/qemu.rs#L436:
goldboot/src/builder/qemu.rs#L436
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:436:18
|
436 | .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/beta/index.html#suspicious_open_options
|
|
[clippy] goldboot/src/builder/qemu.rs#L451:
goldboot/src/builder/qemu.rs#L451
warning: file opened with `create`, but `truncate` behavior not defined
--> goldboot/src/builder/qemu.rs:451:18
|
451 | .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/beta/index.html#suspicious_open_options
|
|
[clippy] goldboot/src/builder/qemu.rs#L482:
goldboot/src/builder/qemu.rs#L482
warning: enclosing `Ok` and `?` operator are unneeded
--> goldboot/src/builder/qemu.rs:482:9
|
482 | / Ok(self.drive_files(HashMap::from([
483 | | ("sshdog".to_string(), sshdog),
484 | | ("host_key".to_string(), host_key),
485 | | ("public_key".to_string(), public_key),
486 | | ]))?)
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_question_mark
help: remove the enclosing `Ok` and `?` operator
|
482 ~ self.drive_files(HashMap::from([
483 | ("sshdog".to_string(), sshdog),
484 | ("host_key".to_string(), host_key),
485 | ("public_key".to_string(), public_key),
486 ~ ]))
|
|
|
[clippy] goldboot/src/builder/qemu.rs#L505:
goldboot/src/builder/qemu.rs#L505
warning: length comparison to zero
--> goldboot/src/builder/qemu.rs:505:30
|
505 | 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/beta/index.html#len_zero
|
|
[clippy] goldboot/src/builder/sources.rs#L21:
goldboot/src/builder/sources.rs#L21
warning: method `default` can be confused for the standard trait method `std::default::Default::default`
--> goldboot/src/builder/sources.rs:21:5
|
21 | / pub fn default() -> Result<Self> {
22 | | let directory = if cfg!(target_os = "linux") {
23 | | PathBuf::from(format!(
24 | | "/home/{}/.cache/goldboot/sources",
... |
43 | | Ok(Self { directory })
44 | | }
| |_____^
|
= 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/beta/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
|
[clippy] goldboot/src/builder/sources.rs#L53:
goldboot/src/builder/sources.rs#L53
warning: this boolean expression can be simplified
--> goldboot/src/builder/sources.rs:53:20
|
53 | if !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
| ____________________^
54 | | .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/beta/index.html#nonminimal_bool
|
|
[clippy] goldboot/src/builder/sources.rs#L52:
goldboot/src/builder/sources.rs#L52
warning: this `if` statement can be collapsed
--> goldboot/src/builder/sources.rs:52:13
|
52 | / if path.is_file() {
53 | | if !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
54 | | .is_ok()
... |
59 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#collapsible_if
help: collapse nested if block
|
52 ~ if path.is_file()
53 ~ && !Self::verify_checksum(path.to_string_lossy().to_string(), checksum.as_str())
54 | .is_ok()
...
57 | std::fs::remove_file(&path)?;
58 ~ }
|
|
|
[clippy] goldboot/src/builder/ssh.rs#L29:
goldboot/src/builder/ssh.rs#L29
warning: the borrowed expression implements the required traits
--> goldboot/src/builder/ssh.rs:29:9
|
29 | &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/beta/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
|
[clippy] goldboot/src/builder/ssh.rs#L56:
goldboot/src/builder/ssh.rs#L56
warning: this creates an owned instance just for comparison
--> goldboot/src/builder/ssh.rs:56:12
|
56 | if entry
| ____________^
57 | | .path()?
58 | | .file_stem()
59 | | .unwrap()
60 | | .to_string_lossy()
61 | | .to_string()
| |________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#cmp_owned
= note: `#[warn(clippy::cmp_owned)]` on by default
help: try
|
56 ~ if entry
57 + .path()?
58 + .file_stem()
59 + .unwrap()
60 + .to_string_lossy()
|
|
|
[clippy] goldboot/src/builder/ssh.rs#L110:
goldboot/src/builder/ssh.rs#L110
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> goldboot/src/builder/ssh.rs:110:45
|
110 | fn connect(username: &str, private_key: &PathBuf, port: u16) -> Result<Session> {
| ^^^^^^^^ help: change this to: `&Path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
|
[clippy] goldboot/src/builder/ssh.rs#L181:
goldboot/src/builder/ssh.rs#L181
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/ssh.rs:181:28
|
181 | channel.setenv(&var, &val)?;
| ^^^^ help: change this to: `var`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/ssh.rs#L181:
goldboot/src/builder/ssh.rs#L181
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/ssh.rs:181:34
|
181 | channel.setenv(&var, &val)?;
| ^^^^ help: change this to: `val`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/vnc.rs#L29:
goldboot/src/builder/vnc.rs#L29
warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
--> goldboot/src/builder/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/beta/index.html#toplevel_ref_arg
= note: `#[warn(clippy::toplevel_ref_arg)]` on by default
|
|
[clippy] goldboot/src/builder/vnc.rs#L163:
goldboot/src/builder/vnc.rs#L163
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> goldboot/src/builder/vnc.rs:163:13
|
163 | / match event {
164 | | Event::Resize(width, height) => {
165 | | self.width = width;
166 | | self.height = height;
167 | | }
168 | | _ => {}
169 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
163 ~ if let Event::Resize(width, height) = event {
164 + self.width = width;
165 + self.height = height;
166 + }
|
|
|
[clippy] goldboot/src/builder/vnc.rs#L238:
goldboot/src/builder/vnc.rs#L238
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/vnc.rs:238:42
|
238 | 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/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/vnc.rs#L325:
goldboot/src/builder/vnc.rs#L325
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/vnc.rs:325:58
|
325 | ... screenshot.write_png(&Path::new("screenshots/frozen.png"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new("screenshots/frozen.png")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/vnc.rs#L379:
goldboot/src/builder/vnc.rs#L379
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/vnc.rs:379:36
|
379 | .write_png(&Path::new(&format!("screenshots/{cmd_number}.png")))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&format!("screenshots/{cmd_number}.png"))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/mod.rs#L136:
goldboot/src/builder/mod.rs#L136
warning: useless conversion to the same type: `std::path::PathBuf`
--> goldboot/src/builder/mod.rs:136:38
|
136 | self.ovmf_path = PathBuf::from(path);
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `PathBuf::from()`: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
|
[clippy] goldboot/src/builder/mod.rs#L163:
goldboot/src/builder/mod.rs#L163
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> goldboot/src/builder/mod.rs:163:35
|
163 | element.build(&self)?;
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_borrow
|
|
[clippy] goldboot/src/builder/mod.rs#L175:
goldboot/src/builder/mod.rs#L175
warning: redundant pattern matching, consider using `is_none()`
--> goldboot/src/builder/mod.rs:175:24
|
175 | if let None = output {
| -------^^^^--------- help: try: `if output.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
|
|
[clippy] goldboot/src/library.rs#L26:
goldboot/src/library.rs#L26
warning: this `if` has identical blocks
--> goldboot/src/library.rs:26:54
|
26 | let directory = if cfg!(target_os = "linux") {
| ______________________________________________________^
27 | | PathBuf::from("/var/lib/goldboot/images")
28 | | } else if cfg!(target_os = "macos") {
| |_________^
|
note: same as this
--> goldboot/src/library.rs:28:45
|
28 | } else if cfg!(target_os = "macos") {
| _____________________________________________^
29 | | PathBuf::from("/var/lib/goldboot/images")
30 | | } else {
| |_________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#if_same_then_else
= note: `#[warn(clippy::if_same_then_else)]` on by default
|
|
[clippy] goldboot/src/library.rs#L120:
goldboot/src/library.rs#L120
warning: enclosing `Ok` and `?` operator are unneeded
--> goldboot/src/library.rs:120:9
|
120 | / Ok(Self::find_all()?
121 | | .into_iter()
122 | | .find(|image| image.id == image_id || image.id[0..12] == image_id[0..12])
123 | | .ok_or_else(|| anyhow!("Image not found"))?)
| |________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#needless_question_mark
help: remove the enclosing `Ok` and `?` operator
|
120 ~ Self::find_all()?
121 | .into_iter()
122 | .find(|image| image.id == image_id || image.id[0..12] == image_id[0..12])
123 ~ .ok_or_else(|| anyhow!("Image not found"))
|
|