Skip to content

Commit d25d23e

Browse files
author
George Cosma
committed
fix: clippy warnings from update of clippy
Signed-off-by: George Cosma <george.cosma@wyliodrin.com>
1 parent 8b43322 commit d25d23e

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

tbf-parser/src/types.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,19 @@ impl fmt::Debug for TbfParseError {
9494
match self {
9595
TbfParseError::NotEnoughFlash => write!(f, "Buffer too short to parse TBF header"),
9696
TbfParseError::UnsupportedVersion(version) => {
97-
write!(f, "TBF version {} unsupported", version)
97+
write!(f, "TBF version {version} unsupported")
9898
}
9999
TbfParseError::ChecksumMismatch(app, calc) => write!(
100100
f,
101-
"Checksum verification failed: app:{:#x}, calc:{:#x}",
102-
app, calc
101+
"Checksum verification failed: app:{app:#x}, calc:{calc:#x}"
103102
),
104-
TbfParseError::BadTlvEntry(tipe) => write!(f, "TLV entry type {} is invalid", tipe),
103+
TbfParseError::BadTlvEntry(tipe) => write!(f, "TLV entry type {tipe} is invalid"),
105104
TbfParseError::BadProcessName => write!(f, "Process name not UTF-8"),
106105
TbfParseError::InternalError => write!(f, "Internal kernel error. This is a bug."),
107106
TbfParseError::TooManyEntries(tipe) => {
108107
write!(
109108
f,
110-
"There are too many variable entries of {} for Tock to parse",
111-
tipe
109+
"There are too many variable entries of {tipe} for Tock to parse"
112110
)
113111
}
114112
TbfParseError::PackageNameTooLong => write!(f, "The package name is too long."),

tock-process-console/src/ui_management/pages/setup_page/setup_page_structure.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl ComponentRender<()> for SetupPage {
207207

208208
let available_ports = match tokio_serial::available_ports() {
209209
Ok(ports) => ports,
210-
Err(error) => panic!("Error while searching for ports: {}", error),
210+
Err(error) => panic!("Error while searching for ports: {error}"),
211211
};
212212

213213
let mut vec_serial: Vec<Text> = vec![];
@@ -261,7 +261,7 @@ impl ComponentRender<()> for SetupPage {
261261
.borders(Borders::ALL)
262262
.border_type(BorderType::Rounded)
263263
.fg(Color::Yellow)
264-
.title(format!(" Number of boards found: {} ", boards_found))
264+
.title(format!(" Number of boards found: {boards_found} "))
265265
.title_style(Style::default().fg(Color::Blue)),
266266
)
267267
.highlight_style(Style::default().add_modifier(Modifier::BOLD))
@@ -275,12 +275,12 @@ impl ComponentRender<()> for SetupPage {
275275
if self.show_state == ShowState::ShowBoardsOnly {
276276
match self.probeinfo_sender.send(board_ports) {
277277
Ok(data) => data,
278-
Err(error) => println!("{}", error),
278+
Err(error) => println!("{error}"),
279279
};
280280
} else if self.show_state == ShowState::ShowAllSerialPorts {
281281
match self.probeinfo_sender.send(serial_ports) {
282282
Ok(data) => data,
283-
Err(error) => println!("{}", error),
283+
Err(error) => println!("{error}"),
284284
};
285285
}
286286

@@ -374,7 +374,7 @@ impl ComponentRender<()> for SetupPage {
374374
frame.render_widget(help_text, help_text_h);
375375

376376
let error = if let Some(error) = &self.properties.error_message {
377-
Text::from(format!("Error: {}", error))
377+
Text::from(format!("Error: {error}"))
378378
} else {
379379
Text::from("")
380380
};

tock-process-console/src/ui_management/pages/terminal_page/section/usage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct UsageInfo {
1616
}
1717

1818
fn key_to_span<'a>(key: &String) -> Span<'a> {
19-
Span::from(format!("( {} )", key)).bold()
19+
Span::from(format!("( {key} )")).bold()
2020
}
2121

2222
pub fn widget_usage_to_text<'a>(usage: UsageInfo) -> Text<'a> {

tockloader-cli/src/display.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use tockloader_lib::attributes::app_attributes::AppAttributes;
66
use tockloader_lib::attributes::system_attributes::SystemAttributes;
77

8+
// TODO(george-cosma): Fix this
9+
#[allow(clippy::uninlined_format_args)]
810
pub async fn print_list(app_details: &[AppAttributes]) {
911
for (i, details) in app_details.iter().enumerate() {
1012
println!("\n\x1b[0m\x1b[1;35m ┏━━━━━━━━━━━━━━━━┓");
@@ -40,6 +42,8 @@ pub async fn print_list(app_details: &[AppAttributes]) {
4042
}
4143
}
4244

45+
// TODO(george-cosma): Fix this
46+
#[allow(clippy::uninlined_format_args)]
4347
pub async fn print_info(app_details: &mut [AppAttributes], system_details: &mut SystemAttributes) {
4448
for (i, details) in app_details.iter().enumerate() {
4549
println!("\n\x1b[0m\x1b[1;35m ┏━━━━━━━━━━━━━━━━┓");

tockloader-lib/src/command_impl/probers/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl CommandInstall for ProbeRSConnection {
131131
}
132132

133133
for i in valid_pages {
134-
println!("Writing page number {}", i);
134+
println!("Writing page number {i}");
135135
// Create the packet that we send to the bootloader. First four
136136
// bytes are the address of the page
137137
let mut pkt = Vec::new();

0 commit comments

Comments
 (0)