Doc comments, format string inlining, long literal separators

- Doc comments on DriveSession, find_drives, all Error variants, Result type
- 24 format! strings inlined (clippy pedantic)
- 25 long hex literals with separators (0xFFFFFFFF → 0xFFFF_FFFF)
- README install example updated to 0.8
This commit is contained in:
MattJackson
2026-04-11 21:04:44 +00:00
parent 1c3f300f2f
commit 9d63ff75e9
15 changed files with 31 additions and 37 deletions
+3 -5
View File
@@ -6,7 +6,7 @@ use crate::identity::DriveId;
pub fn find_drives() -> Vec<(String, DriveId)> {
let mut drives = Vec::new();
for i in 0..16 {
let path = format!("/dev/sg{}", i);
let path = format!("/dev/sg{i}");
if !std::path::Path::new(&path).exists() {
continue;
}
@@ -40,8 +40,7 @@ pub fn resolve_device(path: &str) -> Result<(String, Option<String>)> {
&& sg_id.serial_number == sr_id.serial_number
{
let warning = format!(
"{} is a block device (sr) — using {} (sg) for raw access",
path, sg_path
"{path} is a block device (sr) — using {sg_path} (sg) for raw access"
);
return Ok((sg_path, Some(warning)));
}
@@ -49,8 +48,7 @@ pub fn resolve_device(path: &str) -> Result<(String, Option<String>)> {
return Ok((
path.to_string(),
Some(format!(
"{} is a block device (sr) — no matching sg device found",
path
"{path} is a block device (sr) — no matching sg device found"
)),
));
}