Fix Clippy lints & GitHub Action improvements (#74)

* ci: improve

- run on all branches to test things
- no cargo color, it destroys actions-rs/cargo features
- update versions

* refactor(lint): fix clippy issues

* refactor(lint): fix more clippy issues
This commit is contained in:
EdJoPaTo
2021-11-14 18:59:56 +01:00
committed by Philip Mueller
parent a6984b0b84
commit dc127ed87a
8 changed files with 17 additions and 24 deletions

View File

@@ -30,7 +30,7 @@ impl LoopDevice {
);
info!("Mounted {} to {}", file.display(), path.display());
Ok(LoopDevice { path, losetup })
Ok(Self { path, losetup })
}
pub fn path(&self) -> &Path {

View File

@@ -68,7 +68,7 @@ pub fn get_storage_devices(allow_non_removable: bool) -> anyhow::Result<Vec<Devi
.context("Could not parse block size to unsigned integer (u128)")?
* 512,
),
})
});
}
Ok(result)

View File

@@ -21,7 +21,7 @@ impl<'a> StorageDevice<'a> {
.context("Error querying information about the block device")?;
let device_name = path
.file_name()
.and_then(|s| s.to_str())
.and_then(std::ffi::OsStr::to_str)
.map(String::from)
.ok_or_else(|| anyhow!("Invalid device name: {}", path.display()))?;