Skip to content

Commit 75a1f0e

Browse files
committed
fix: Clippy lints and fmt
1 parent 5fd17c9 commit 75a1f0e

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

pueue/src/client/commands/edit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl Editable for EditableTask {
226226
Error::IoPathError(label_path.clone(), "creating temporary label file", err)
227227
})?;
228228
if let Some(label) = &self.label {
229-
write!(output, "{}", label)
229+
write!(output, "{label}")
230230
.map_err(|err| Error::IoPathError(label_path.clone(), "writing label file", err))?;
231231
}
232232

pueue/src/daemon/network/message_handler/edit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ pub fn edit_restore(state: &SharedState, task_ids: Vec<usize>) -> Response {
7878
match state.tasks_mut().get_mut(task_id) {
7979
Some(task) => {
8080
let TaskStatus::Locked { previous_status } = &task.status else {
81-
failed_tasks.push(format!("Task {} isn't locked! Cannot be unlocked", task_id));
81+
failed_tasks.push(format!("Task {task_id} isn't locked! Cannot be unlocked"));
8282
continue;
8383
};
8484

8585
// Restore the task to its previous state.
8686
task.status = *previous_status.clone();
8787
}
88-
None => failed_tasks.push(format!("No task with id {}! Cannot be unlocked.", task_id)),
88+
None => failed_tasks.push(format!("No task with id {task_id}! Cannot be unlocked.")),
8989
}
9090
}
9191

pueue/src/daemon/process_handler/spawn.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,15 @@ pub fn spawn_process(settings: &Settings, state: &mut LockedState, task_id: usiz
184184
let child = match spawned_command {
185185
Ok(child) => child,
186186
Err(err) => {
187-
let error_msg = format!("Failed to spawn child {task_id} with err: {:?}", err);
187+
let error_msg = format!("Failed to spawn child {task_id} with err: {err:?}");
188188
error!(?err, "Failed to spawn child {task_id}");
189189
trace!(?command, "Command that failed");
190190

191191
// Write some debug log output to the task's log file.
192192
// This should always work, but print a datailed error if it didn't work.
193193
if let Ok(mut file) = get_writable_log_file_handle(task_id, &pueue_directory) {
194-
let log_output = format!(
195-
"Pueue error, failed to spawn task. Check your command.\n{}",
196-
error_msg
197-
);
194+
let log_output =
195+
format!("Pueue error, failed to spawn task. Check your command.\n{error_msg}");
198196
let write_result = file.write_all(log_output.as_bytes());
199197
if let Err(write_err) = write_result {
200198
error!("Failed to write spawn error to task log: {}", write_err);

0 commit comments

Comments
 (0)