mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Format
This commit is contained in:
parent
bd9ccd30e1
commit
daca83c7d2
1 changed files with 7 additions and 11 deletions
|
|
@ -1,15 +1,11 @@
|
|||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
use super::Style;
|
||||
use crate::{
|
||||
preset::Preset,
|
||||
theme::{Color, StyleShadow},
|
||||
Pattern,
|
||||
};
|
||||
use crate::{preset::Preset, theme::{Color, StyleShadow}, Pattern};
|
||||
|
||||
pub struct Icon {
|
||||
pub name: Pattern,
|
||||
pub text: String,
|
||||
pub name: Pattern,
|
||||
pub text: String,
|
||||
pub style: Style,
|
||||
}
|
||||
|
||||
|
|
@ -20,11 +16,11 @@ impl Icon {
|
|||
{
|
||||
#[derive(Deserialize)]
|
||||
struct IconOuter {
|
||||
rules: Vec<IconRule>,
|
||||
rules: Vec<IconRule>,
|
||||
#[serde(default)]
|
||||
prepend_rules: Vec<IconRule>,
|
||||
#[serde(default)]
|
||||
append_rules: Vec<IconRule>,
|
||||
append_rules: Vec<IconRule>,
|
||||
}
|
||||
#[derive(Deserialize)]
|
||||
struct IconRule {
|
||||
|
|
@ -44,8 +40,8 @@ impl Icon {
|
|||
.rules
|
||||
.into_iter()
|
||||
.map(|r| Icon {
|
||||
name: r.name,
|
||||
text: r.text,
|
||||
name: r.name,
|
||||
text: r.text,
|
||||
style: StyleShadow { fg: r.fg, ..Default::default() }.into(),
|
||||
})
|
||||
.collect(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue