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 serde::{Deserialize, Deserializer};
|
||||||
|
|
||||||
use super::Style;
|
use super::Style;
|
||||||
use crate::{
|
use crate::{preset::Preset, theme::{Color, StyleShadow}, Pattern};
|
||||||
preset::Preset,
|
|
||||||
theme::{Color, StyleShadow},
|
|
||||||
Pattern,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct Icon {
|
pub struct Icon {
|
||||||
pub name: Pattern,
|
pub name: Pattern,
|
||||||
pub text: String,
|
pub text: String,
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -20,11 +16,11 @@ impl Icon {
|
||||||
{
|
{
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct IconOuter {
|
struct IconOuter {
|
||||||
rules: Vec<IconRule>,
|
rules: Vec<IconRule>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
prepend_rules: Vec<IconRule>,
|
prepend_rules: Vec<IconRule>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
append_rules: Vec<IconRule>,
|
append_rules: Vec<IconRule>,
|
||||||
}
|
}
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct IconRule {
|
struct IconRule {
|
||||||
|
|
@ -44,8 +40,8 @@ impl Icon {
|
||||||
.rules
|
.rules
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|r| Icon {
|
.map(|r| Icon {
|
||||||
name: r.name,
|
name: r.name,
|
||||||
text: r.text,
|
text: r.text,
|
||||||
style: StyleShadow { fg: r.fg, ..Default::default() }.into(),
|
style: StyleShadow { fg: r.fg, ..Default::default() }.into(),
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue