mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 06:59:28 +02:00
Make Clippy happy
This commit is contained in:
parent
a56ed3752b
commit
4ea5807a5a
@ -7,8 +7,12 @@ stages:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
container: 'rust:latest'
|
||||
steps:
|
||||
- script: cargo fmt -- --check
|
||||
displayName: Check Formatting
|
||||
- script: cargo check --all
|
||||
displayName: Run check
|
||||
displayName: Check
|
||||
- script: cargo clippy
|
||||
displayName: Clippy
|
||||
|
||||
- stage: Build
|
||||
jobs:
|
||||
|
@ -126,6 +126,7 @@ fn select_block_device(running: Arc<AtomicBool>) -> Result<PathBuf, Error> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::cognitive_complexity)]
|
||||
fn create(command: CreateCommand, running: Arc<AtomicBool>) -> Result<(), Error> {
|
||||
let presets = presets::Presets::load(&command.presets)?;
|
||||
|
||||
|
@ -16,22 +16,19 @@ pub struct StorageDevice<'a> {
|
||||
|
||||
impl<'a> StorageDevice<'a> {
|
||||
pub fn from_path(path: &'a Path) -> Result<Self, Error> {
|
||||
let real_path = path.canonicalize().context(ErrorKind::DeviceQuery)?;
|
||||
let device_name = real_path
|
||||
debug!("path: {:?}", path);
|
||||
let path = path.canonicalize().context(ErrorKind::DeviceQuery)?;
|
||||
let device_name = path
|
||||
.file_name()
|
||||
.and_then(|s| s.to_str())
|
||||
.map(String::from)
|
||||
.ok_or_else(|| Error::from(ErrorKind::InvalidDeviceName))?;
|
||||
|
||||
debug!(
|
||||
"path: {:?}, real path: {:?}, device name: {:?}",
|
||||
path, real_path, device_name
|
||||
);
|
||||
debug!("real path: {:?}, device name: {:?}", path, device_name);
|
||||
|
||||
drop(path);
|
||||
let _self = Self {
|
||||
name: device_name,
|
||||
path: real_path,
|
||||
path,
|
||||
origin: PhantomData,
|
||||
};
|
||||
if !(_self.is_removable_device()? || _self.is_loop_device()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user