Skip to content

Make LEDs state setable one by one #4

Make LEDs state setable one by one

Make LEDs state setable one by one #4

GitHub Actions / clippy succeeded Nov 22, 2023 in 0s

clippy

23 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 23
Note 0
Help 0

Versions

  • rustc 1.74.0 (79e9716c9 2023-11-13)
  • cargo 1.74.0 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (79e9716 2023-11-13)

Annotations

Check warning on line 237 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:237:36
    |
237 |         .map_err(|err| CustomError(format!("can't release the writable USB endpoint: {}", err)))?;
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
237 -         .map_err(|err| CustomError(format!("can't release the writable USB endpoint: {}", err)))?;
237 +         .map_err(|err| CustomError(format!("can't release the writable USB endpoint: {err}")))?;
    |

Check warning on line 225 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:225:25
    |
225 |             CustomError(format!("can't write the Warthog throttle configuration: {}", err))
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
225 -             CustomError(format!("can't write the Warthog throttle configuration: {}", err))
225 +             CustomError(format!("can't write the Warthog throttle configuration: {err}"))
    |

Check warning on line 217 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:217:5
    |
217 |     println!("Setting the Warthog throttle LEDs to {} and the intensity to {}...", leds, intensity);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
217 -     println!("Setting the Warthog throttle LEDs to {} and the intensity to {}...", leds, intensity);
217 +     println!("Setting the Warthog throttle LEDs to {leds} and the intensity to {intensity}...");
    |

Check warning on line 215 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:215:36
    |
215 |         .map_err(|err| CustomError(format!("can't configure readable endpoint: {}", err)))?;
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
215 -         .map_err(|err| CustomError(format!("can't configure readable endpoint: {}", err)))?;
215 +         .map_err(|err| CustomError(format!("can't configure readable endpoint: {err}")))?;
    |

Check warning on line 214 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/main.rs:214:42
    |
214 |     usb::configure_endpoint(&mut handle, &writable_endpoint)
    |                                          ^^^^^^^^^^^^^^^^^^ help: change this to: `writable_endpoint`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 152 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:152:36
    |
152 |         .map_err(|err| CustomError(format!("can't release the readable USB endpoint: {}", err)))?;
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
152 -         .map_err(|err| CustomError(format!("can't release the readable USB endpoint: {}", err)))?;
152 +         .map_err(|err| CustomError(format!("can't release the readable USB endpoint: {err}")))?;
    |

Check warning on line 148 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:148:5
    |
148 |     println!("Intensity: {}", current_intensity);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
148 -     println!("Intensity: {}", current_intensity);
148 +     println!("Intensity: {current_intensity}");
    |

Check warning on line 147 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:147:5
    |
147 |     println!("LEDs: {}", current_leds);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
147 -     println!("LEDs: {}", current_leds);
147 +     println!("LEDs: {current_leds}");
    |

Check warning on line 143 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:143:25
    |
143 |             CustomError(format!("can't read the Warthog throttle configuration: {}", err))
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
143 -             CustomError(format!("can't read the Warthog throttle configuration: {}", err))
143 +             CustomError(format!("can't read the Warthog throttle configuration: {err}"))
    |

Check warning on line 136 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:136:36
    |
136 |         .map_err(|err| CustomError(format!("can't configure readable endpoint: {}", err)))?;
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
136 -         .map_err(|err| CustomError(format!("can't configure readable endpoint: {}", err)))?;
136 +         .map_err(|err| CustomError(format!("can't configure readable endpoint: {err}")))?;
    |

Check warning on line 135 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/main.rs:135:42
    |
135 |     usb::configure_endpoint(&mut handle, &readable_endpoint)
    |                                          ^^^^^^^^^^^^^^^^^^ help: change this to: `readable_endpoint`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 110 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:110:36
    |
110 |         .map_err(|err| CustomError(format!("can't find USB endpoints: {}", err)))?;
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
110 -         .map_err(|err| CustomError(format!("can't find USB endpoints: {}", err)))?;
110 +         .map_err(|err| CustomError(format!("can't find USB endpoints: {err}")))?;
    |

Check warning on line 105 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/main.rs:105:40
    |
105 |             .map_err(|err| CustomError(format!("can't print the device info: {}", err)))?;
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
105 -             .map_err(|err| CustomError(format!("can't print the device info: {}", err)))?;
105 +             .map_err(|err| CustomError(format!("can't print the device info: {err}")))?;
    |

Check warning on line 87 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
  --> src/main.rs:87:36
   |
87 |         .map_err(|err| CustomError(format!("can't create a USB context: {}", err)))?;
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
   |
87 -         .map_err(|err| CustomError(format!("can't create a USB context: {}", err)))?;
87 +         .map_err(|err| CustomError(format!("can't create a USB context: {err}")))?;
   |

Check warning on line 242 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many lines (115/100)

warning: this function has too many lines (115/100)
   --> src/main.rs:83:1
    |
83  | / fn main() -> Result<(), CustomError> {
84  | |     let matches = command_line_args().get_matches();
85  | |
86  | |     let mut context = Context::new()
...   |
241 | |     Ok(())
242 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
    = note: `#[warn(clippy::too_many_lines)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 141 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
   --> src/usb.rs:141:9
    |
141 |         println!("{:02X?}", data);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
141 -         println!("{:02X?}", data);
141 +         println!("{data:02X?}");
    |

Check warning on line 93 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
  --> src/usb.rs:93:25
   |
93 |                         println!("{:#?}", endpoint_desc);
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
   |
93 -                         println!("{:#?}", endpoint_desc);
93 +                         println!("{endpoint_desc:#?}");
   |

Check warning on line 88 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
  --> src/usb.rs:88:21
   |
88 |                     println!("{:#?}", interface_desc);
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
   |
88 -                     println!("{:#?}", interface_desc);
88 +                     println!("{interface_desc:#?}");
   |

Check warning on line 82 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
  --> src/usb.rs:82:13
   |
82 |             println!("{:#?}", config_desc);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
   |
82 -             println!("{:#?}", config_desc);
82 +             println!("{config_desc:#?}");
   |

Check warning on line 79 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be rewritten as `let...else`

warning: this could be rewritten as `let...else`
  --> src/usb.rs:76:9
   |
76 | /         let config_desc = match device.config_descriptor(n) {
77 | |             Ok(c) => c,
78 | |             Err(_) => continue,
79 | |         };
   | |__________^ help: consider writing: `let Ok(config_desc) = device.config_descriptor(n) else { continue };`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

Check warning on line 43 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
  --> src/usb.rs:43:9
   |
43 |         println!("Language: {:?}", language);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
help: change this to
   |
43 -         println!("Language: {:?}", language);
43 +         println!("Language: {language:?}");
   |

Check warning on line 21 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be rewritten as `let...else`

warning: this could be rewritten as `let...else`
  --> src/usb.rs:18:9
   |
18 | /         let device_desc = match device.device_descriptor() {
19 | |             Ok(d) => d,
20 | |             Err(_) => continue,
21 | |         };
   | |__________^ help: consider writing: `let Ok(device_desc) = device.device_descriptor() else { continue };`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else

Check warning on line 15 in src/usb.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be rewritten as `let...else`

warning: this could be rewritten as `let...else`
  --> src/usb.rs:12:5
   |
12 | /     let devices = match context.devices() {
13 | |         Ok(d) => d,
14 | |         Err(_) => return None,
15 | |     };
   | |______^ help: consider writing: `let Ok(devices) = context.devices() else { return None };`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
note: the lint level is defined here
  --> src/main.rs:1:9
   |
1  | #![warn(clippy::pedantic)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(clippy::manual_let_else)]` implied by `#[warn(clippy::pedantic)]`