mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Format
This commit is contained in:
parent
9c098166fb
commit
1aedb9e2a6
2 changed files with 3 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use std::{path::Path, str::FromStr};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
use yazi_shared::{MIME_DIR, fs::File};
|
||||
use yazi_shared::{fs::File, MIME_DIR};
|
||||
|
||||
use super::{Color, Style, StyleShadow};
|
||||
use crate::Pattern;
|
||||
|
|
@ -20,7 +20,7 @@ impl FromStr for FileKind {
|
|||
match s {
|
||||
"executable" => Ok(Self::Executable),
|
||||
"symlink" => Ok(Self::Symlink),
|
||||
_ => Err(anyhow::anyhow!("invalid file kind"))
|
||||
_ => Err(anyhow::anyhow!("invalid file kind")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,13 +87,7 @@ impl<'a, 'b> Folder<'a, 'b> {
|
|||
cx.manager.mimetype.get(&file.url).map(|x| &**x)
|
||||
};
|
||||
|
||||
Ok(
|
||||
THEME
|
||||
.filetypes
|
||||
.iter()
|
||||
.find(|&x| x.matches(&file, mime))
|
||||
.map(|x| Style::from(x.style)),
|
||||
)
|
||||
Ok(THEME.filetypes.iter().find(|&x| x.matches(&file, mime)).map(|x| Style::from(x.style)))
|
||||
});
|
||||
reg.add_function("is_hovered", |_, me: AnyUserData| {
|
||||
let folder = me.named_user_value::<FolderRef>("folder")?;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue