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