lsd-rs / lsd

The next gen ls command
Apache License 2.0
13.47k stars 436 forks source link

refactoring `src/theme/icons.rs` #821

Open scarf005 opened 1 year ago

scarf005 commented 1 year ago

Directly using emojis

https://github.com/lsd-rs/lsd/blob/ea56a7c385db4d4e67992d2d13de94ebc2a97234/src/theme/icon.rs#L41-L56

would it be useful to directly use emoji?

impl Default for ByType {
    fn default() -> ByType {
        ByType {
            dir: "".into(),          // 
            file: "".into(),         // 
            pipe: "".into(),         // 
            socket: "".into(),       // 
            executable: "".into(),   // 
            symlink_dir: "".into(),  // 
            symlink_file: "".into(), // 
            device_char: "".into(),  // 
            device_block: "ﰩ".into(), // ﰩ
            special: "".into(),      // 
        }
    }
}

Compiletime Hashset

https://github.com/lsd-rs/lsd/blob/ea56a7c385db4d4e67992d2d13de94ebc2a97234/src/theme/icon.rs#L99-L101

using phf set could help with storing duplicate default values

zwpaper commented 1 year ago

Hi @scarf005, we originally launched with nerd font, and we would keep the nerd font as the default.

and we now provide the icon theme, so that you could always create an icon theme by yourself, using anything you like, emoji of cause.

also, as emoji now rules the world, maybe it is not a bad idea to provide an optional built-in theme using emoji.

/kind enhancement