mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-12-06 19:39:20 +01:00
Dependencies bump and compilation fixes
This commit is contained in:
@@ -17,11 +17,11 @@ pub struct EncryptedDevice<'t, 'o> {
|
||||
cryptsetup: &'t Tool,
|
||||
name: String,
|
||||
path: PathBuf,
|
||||
origin: PhantomData<&'o BlockDevice>,
|
||||
origin: PhantomData<&'o dyn BlockDevice>,
|
||||
}
|
||||
|
||||
impl<'t, 'o> EncryptedDevice<'t, 'o> {
|
||||
pub fn prepare(cryptsetup: &Tool, device: &BlockDevice) -> Result<(), Error> {
|
||||
pub fn prepare(cryptsetup: &Tool, device: &dyn BlockDevice) -> Result<(), Error> {
|
||||
debug!("Preparing encrypted device in {}", device.path().display());
|
||||
cryptsetup
|
||||
.execute()
|
||||
@@ -35,7 +35,7 @@ impl<'t, 'o> EncryptedDevice<'t, 'o> {
|
||||
|
||||
pub fn open(
|
||||
cryptsetup: &'t Tool,
|
||||
device: &'o BlockDevice,
|
||||
device: &'o dyn BlockDevice,
|
||||
name: String,
|
||||
) -> Result<EncryptedDevice<'t, 'o>, Error> {
|
||||
debug!(
|
||||
@@ -85,7 +85,7 @@ impl<'t, 'o> BlockDevice for EncryptedDevice<'t, 'o> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_encrypted_device(device: &BlockDevice) -> Result<bool, Error> {
|
||||
pub fn is_encrypted_device(device: &dyn BlockDevice) -> Result<bool, Error> {
|
||||
let mut f = fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.write(false)
|
||||
|
||||
@@ -23,12 +23,12 @@ impl FilesystemType {
|
||||
#[derive(Debug)]
|
||||
pub struct Filesystem<'a> {
|
||||
fs_type: FilesystemType,
|
||||
block: &'a BlockDevice,
|
||||
block: &'a dyn BlockDevice,
|
||||
}
|
||||
|
||||
impl<'a> Filesystem<'a> {
|
||||
pub fn format(
|
||||
block: &'a BlockDevice,
|
||||
block: &'a dyn BlockDevice,
|
||||
fs_type: FilesystemType,
|
||||
mkfs: &Tool,
|
||||
) -> Result<Self, Error> {
|
||||
@@ -43,11 +43,11 @@ impl<'a> Filesystem<'a> {
|
||||
Ok(Self { fs_type, block })
|
||||
}
|
||||
|
||||
pub fn from_partition(block: &'a BlockDevice, fs_type: FilesystemType) -> Self {
|
||||
pub fn from_partition(block: &'a dyn BlockDevice, fs_type: FilesystemType) -> Self {
|
||||
Self { fs_type, block }
|
||||
}
|
||||
|
||||
pub fn block(&self) -> &BlockDevice {
|
||||
pub fn block(&self) -> &dyn BlockDevice {
|
||||
self.block
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
|
||||
#[derive(Debug)]
|
||||
pub struct Partition<'a> {
|
||||
path: PathBuf,
|
||||
origin: PhantomData<&'a Origin>,
|
||||
origin: PhantomData<&'a dyn Origin>,
|
||||
}
|
||||
|
||||
impl<'a> Partition<'a> {
|
||||
|
||||
@@ -81,7 +81,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn sanity() {
|
||||
let devices = get_removable_devices().unwrap();
|
||||
let devices = get_storage_devices(false).unwrap();
|
||||
println!("{:?}", devices);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
|
||||
pub struct StorageDevice<'a> {
|
||||
name: String,
|
||||
path: PathBuf,
|
||||
origin: PhantomData<&'a Origin>,
|
||||
origin: PhantomData<&'a dyn Origin>,
|
||||
}
|
||||
|
||||
impl<'a> StorageDevice<'a> {
|
||||
|
||||
Reference in New Issue
Block a user