Skip to content

Commit 6f6f563

Browse files
committed
lint
1 parent 7db69a8 commit 6f6f563

File tree

25 files changed

+285
-218
lines changed

25 files changed

+285
-218
lines changed

devenv-cache-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ pub mod time;
1818
// Re-export common types for convenience
1919
pub use db::Database;
2020
pub use error::{CacheError, CacheResult};
21-
pub use file::{compute_file_hash, compute_string_hash, TrackedFile};
21+
pub use file::{TrackedFile, compute_file_hash, compute_string_hash};

devenv-eval-cache/src/bin/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ async fn main() -> Result<(), command::CommandError> {
1212
// Connect to database and run migrations
1313
let db = devenv_cache_core::db::Database::new(path, &db::MIGRATIONS)
1414
.await
15-
.map_err(|e| {
16-
command::CommandError::Io(std::io::Error::other(e))
17-
})?;
15+
.map_err(|e| command::CommandError::Io(std::io::Error::other(e)))?;
1816
let pool = db.pool().clone();
1917

2018
let mut cmd = Command::new("nix");

devenv-eval-cache/src/command.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,7 @@ impl FileInputDesc {
339339
Some(compute_string_hash(&paths))
340340
} else {
341341
compute_file_hash(&path)
342-
.map_err(|e| {
343-
std::io::Error::other(
344-
format!("Failed to compute file hash: {e}"),
345-
)
346-
})
342+
.map_err(|e| std::io::Error::other(format!("Failed to compute file hash: {e}")))
347343
.ok()
348344
};
349345
let modified_at = truncate_to_seconds(
@@ -645,11 +641,8 @@ fn check_file_state(file: &FileInputDesc) -> io::Result<FileState> {
645641
.collect::<String>();
646642
compute_string_hash(&paths)
647643
} else {
648-
compute_file_hash(&file.path).map_err(|e| {
649-
std::io::Error::other(
650-
format!("Failed to compute file hash: {e}"),
651-
)
652-
})?
644+
compute_file_hash(&file.path)
645+
.map_err(|e| std::io::Error::other(format!("Failed to compute file hash: {e}")))?
653646
};
654647

655648
if Some(&new_hash) == file.content_hash.as_ref() {
@@ -711,11 +704,7 @@ mod test {
711704
let modified_at = metadata.modified().unwrap();
712705
let truncated_modified_at = truncate_to_seconds(modified_at).unwrap();
713706
let content_hash = compute_file_hash(&file_path)
714-
.map_err(|e| {
715-
std::io::Error::other(
716-
format!("Failed to compute file hash: {e}"),
717-
)
718-
})
707+
.map_err(|e| std::io::Error::other(format!("Failed to compute file hash: {e}")))
719708
.unwrap();
720709

721710
db::FileInputRow {

devenv-generate/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use clap::{crate_version, Parser};
1+
use clap::{Parser, crate_version};
22
use devenv::{
33
default_system,
44
log::{self, LogFormat},
55
};
6-
use miette::{bail, IntoDiagnostic, Result};
6+
use miette::{IntoDiagnostic, Result, bail};
77
use similar::{ChangeTag, TextDiff};
88
use std::path::{Path, PathBuf};
99
use tracing::{info, warn};

devenv-run-tests/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clap::Parser;
2-
use devenv::{log, Devenv, DevenvOptions};
2+
use devenv::{Devenv, DevenvOptions, log};
33
use miette::{IntoDiagnostic, Result, WrapErr};
44
use serde::{Deserialize, Serialize};
55
use std::{

devenv-tasks/src/error.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ impl Display for Error {
3232
),
3333
Error::TaskNotFound(task) => write!(f, "Task does not exist: {task}"),
3434
Error::CycleDetected(task) => write!(f, "Cycle detected at task: {task}"),
35-
Error::MissingCommand(task) => write!(
36-
f,
37-
"Task {task} defined a status, but is missing a command"
38-
),
35+
Error::MissingCommand(task) => {
36+
write!(f, "Task {task} defined a status, but is missing a command")
37+
}
3938
Error::InvalidTaskName(task) => write!(
4039
f,
4140
"Invalid task name: {task}, expected [a-zA-Z-_]+:[a-zA-Z-_]+"

devenv-tasks/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clap::{Parser, Subcommand};
22
use devenv_tasks::{
3-
signal_handler::SignalHandler, Config, RunMode, TaskConfig, TasksUi, VerbosityLevel,
3+
Config, RunMode, TaskConfig, TasksUi, VerbosityLevel, signal_handler::SignalHandler,
44
};
55
use std::env;
66

devenv-tasks/src/signal_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use nix::sys::signal::{self, SaFlags, SigAction, SigHandler, SigSet, Signal};
22
use nix::unistd;
3-
use std::sync::atomic::{AtomicI32, Ordering};
43
use std::sync::Arc;
5-
use tokio::signal::unix::{signal, SignalKind};
4+
use std::sync::atomic::{AtomicI32, Ordering};
5+
use tokio::signal::unix::{SignalKind, signal};
66
use tokio_util::sync::CancellationToken;
77
use tracing::debug;
88

0 commit comments

Comments
 (0)