mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 06:59:28 +02:00
Fix clippy warnings
This commit is contained in:
parent
5f30a38b4a
commit
f32a90e896
@ -16,13 +16,14 @@ impl BlockDevice {
|
||||
.file_name()
|
||||
.and_then(|s| s.to_str())
|
||||
.map(String::from)
|
||||
.ok_or(Error::from(ErrorKind::InvalidDeviceName))?;
|
||||
.ok_or_else(|| Error::from(ErrorKind::InvalidDeviceName))?;
|
||||
|
||||
debug!(
|
||||
"path: {:?}, real path: {:?}, device name: {:?}",
|
||||
path, real_path, device_name
|
||||
);
|
||||
|
||||
drop(path);
|
||||
let _self = Self { name: device_name };
|
||||
if !(_self.is_removable()? || _self.is_loop_device()) {
|
||||
return Err(ErrorKind::DangerousDevice)?;
|
||||
|
@ -95,6 +95,6 @@ impl From<ErrorKind> for Error {
|
||||
|
||||
impl From<Context<ErrorKind>> for Error {
|
||||
fn from(inner: Context<ErrorKind>) -> Error {
|
||||
Error { inner: inner }
|
||||
Error { inner }
|
||||
}
|
||||
}
|
||||
|
@ -6,14 +6,14 @@ use nix::mount::{mount, umount, MsFlags};
|
||||
use std::borrow::Cow;
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Filesystem {
|
||||
Ext4,
|
||||
Vfat,
|
||||
}
|
||||
|
||||
impl Filesystem {
|
||||
fn to_type(&self) -> &'static str {
|
||||
fn to_type(self) -> &'static str {
|
||||
match self {
|
||||
Filesystem::Ext4 => "ext4",
|
||||
Filesystem::Vfat => "vfat",
|
||||
|
Loading…
x
Reference in New Issue
Block a user