mirror of https://github.com/bobwen-dev/hunter
fixed crash on fbsd+zfs. have fun ;)
This commit is contained in:
parent
caf242986c
commit
e5c61ea63e
|
@ -1184,7 +1184,7 @@ impl FileBrowser {
|
||||||
let dev = fs.get_dev();
|
let dev = fs.get_dev();
|
||||||
let free_space = fs.get_free();
|
let free_space = fs.get_free();
|
||||||
let total_space = fs.get_total();
|
let total_space = fs.get_total();
|
||||||
let space = format!("{}: {} / {}",
|
let space = format!("{}{} / {}",
|
||||||
dev,
|
dev,
|
||||||
free_space,
|
free_space,
|
||||||
total_space);
|
total_space);
|
||||||
|
|
|
@ -66,10 +66,9 @@ pub trait FsExt {
|
||||||
impl FsExt for Filesystem {
|
impl FsExt for Filesystem {
|
||||||
fn get_dev(&self) -> String {
|
fn get_dev(&self) -> String {
|
||||||
let path = PathBuf::from(&self.fs_mounted_from);
|
let path = PathBuf::from(&self.fs_mounted_from);
|
||||||
let dev = path.components().last().unwrap();
|
let dev = match path.components().last() {
|
||||||
let dev = match dev {
|
Some(Component::Normal(dev)) => dev.to_string_lossy().to_string() + ": ",
|
||||||
Component::Normal(dev) => dev.to_string_lossy().to_string(),
|
_ => "".to_string()
|
||||||
_ => "wtf".to_string()
|
|
||||||
};
|
};
|
||||||
dev
|
dev
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue