Code audit: fix unused variables, update docs

- Fix unused variable warnings in profile parsing (|e| -> |_|)
- Fix outdated 'freemkv info --share' reference in README (now drive-info)
This commit is contained in:
MattJackson
2026-04-10 08:19:01 -07:00
parent 5949bcee89
commit ad592d244b
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ All errors are structured with numeric codes. No user-facing English text — ap
## Contributing
Run `freemkv info --share` with the [freemkv CLI](https://github.com/freemkv/freemkv) to contribute your drive's profile.
Run `freemkv drive-info --share` with the [freemkv CLI](https://github.com/freemkv/freemkv) to contribute your drive's profile.
## License
+3 -3
View File
@@ -65,12 +65,12 @@ pub struct ProfileMatch {
fn parse_hex4(s: &str) -> Result<[u8; 4]> {
if s.len() != 8 {
return Err(Error::ProfileParse { detail: format!("expected 8 hex chars, got {}", s.len()) });
return Err(Error::ProfileParse);
}
let mut out = [0u8; 4];
for i in 0..4 {
out[i] = u8::from_str_radix(&s[i*2..i*2+2], 16)
.map_err(|e| Error::ProfileParse { detail: format!("bad hex: {e}") })?;
.map_err(|_| Error::ProfileParse)?;
}
Ok(out)
}
@@ -102,7 +102,7 @@ pub fn load_bundled() -> Result<ProfilesFile> {
fn load_from_str(data: &str) -> Result<ProfilesFile> {
serde_json::from_str(data)
.map_err(|e| Error::ProfileParse { detail: format!("JSON: {e}") })
.map_err(|_| Error::ProfileParse)
}
/// Find a profile matching a drive's INQUIRY fields.