lsd/src/icon.rs

447 lines
17 KiB
Rust
Raw Normal View History

2019-02-09 10:41:42 +00:00
use crate::meta::{FileType, Name};
use std::collections::HashMap;
2018-12-08 18:52:56 +00:00
pub struct Icons {
2018-12-13 13:51:31 +00:00
display_icons: bool,
2018-12-08 18:52:56 +00:00
icons_by_name: HashMap<&'static str, &'static str>,
icons_by_extension: HashMap<&'static str, &'static str>,
default_folder_icon: &'static str,
default_file_icon: &'static str,
2018-12-08 18:52:56 +00:00
}
2018-12-13 13:51:31 +00:00
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum Theme {
NoIcon,
Fancy,
Unicode,
2018-12-13 13:51:31 +00:00
}
2019-11-04 13:58:35 +00:00
const ICON_SPACE: &str = " ";
2018-12-13 13:51:31 +00:00
2018-11-25 16:07:28 +00:00
// In order to add a new icon, write the unicode value like "\ue5fb" then
// run the command below in vim:
//
// s#\\u[0-9a-f]*#\=eval('"'.submatch(0).'"')#
2018-12-08 18:52:56 +00:00
impl Icons {
2018-12-13 13:51:31 +00:00
pub fn new(theme: Theme) -> Self {
let display_icons = theme == Theme::Fancy || theme == Theme::Unicode;
let (icons_by_name, icons_by_extension, default_file_icon, default_folder_icon) =
if theme == Theme::Fancy {
(
Self::get_default_icons_by_name(),
Self::get_default_icons_by_extension(),
2019-01-18 17:17:11 +00:00
"\u{f016}", // 
"\u{f115}", // 
)
} else {
2019-01-18 17:17:11 +00:00
(
HashMap::new(),
HashMap::new(),
"\u{1f5cb}", // 🗋
"\u{1f5c1}", // 🗁
2019-01-18 17:17:11 +00:00
)
};
2018-12-13 15:50:47 +00:00
Self {
display_icons,
icons_by_name,
icons_by_extension,
default_file_icon,
default_folder_icon,
2018-12-08 18:52:56 +00:00
}
}
2018-12-13 13:51:31 +00:00
pub fn get(&self, name: &Name) -> String {
if !self.display_icons {
return String::new();
}
// Check file types
let file_type: FileType = name.file_type();
2020-02-04 05:13:18 +00:00
let icon = if let FileType::Directory { .. } = file_type {
self.default_folder_icon
} else if let FileType::SymLink { is_dir: true } = file_type {
2020-05-11 23:29:38 +00:00
"\u{f482}" // ""
} else if let FileType::SymLink { is_dir: false } = file_type {
"\u{f481}" // ""
} else if let FileType::Socket = file_type {
2020-02-04 05:13:18 +00:00
"\u{f6a7}" // ""
} else if let FileType::Pipe = file_type {
2020-02-04 05:13:18 +00:00
"\u{f731}" // ""
} else if let FileType::CharDevice = file_type {
2020-02-04 05:13:18 +00:00
"\u{e601}" // ""
} else if let FileType::BlockDevice = file_type {
2020-02-04 05:13:18 +00:00
"\u{fc29}" // "ﰩ"
} else if let FileType::Special = file_type {
2020-02-04 05:13:18 +00:00
"\u{f2dc}" // ""
} else if let Some(icon) = self.icons_by_name.get(name.file_name()) {
2020-02-02 13:55:44 +00:00
// Use the known names.
2020-02-04 05:13:18 +00:00
icon
2020-02-04 04:32:36 +00:00
} else if let Some(icon) = name
.extension()
.and_then(|extension| self.icons_by_extension.get(extension))
{
2020-02-02 13:55:44 +00:00
// Use the known extensions.
2020-02-04 05:13:18 +00:00
icon
2020-02-02 13:55:44 +00:00
} else {
// Use the default icons.
2020-02-04 05:13:18 +00:00
self.default_file_icon
};
format!("{}{}", icon, ICON_SPACE)
2018-12-08 18:52:56 +00:00
}
fn get_default_icons_by_name() -> HashMap<&'static str, &'static str> {
let mut m = HashMap::new();
2018-12-13 15:50:47 +00:00
m.insert(".Trash", "\u{f1f8}"); // ""
m.insert(".atom", "\u{e764}"); // ""
2018-12-14 15:43:05 +00:00
m.insert(".bashprofile", "\u{e615}"); // ""
m.insert(".bashrc", "\u{f489}"); // ""
2018-12-13 15:50:47 +00:00
m.insert(".git", "\u{f1d3}"); // ""
2019-07-31 08:58:10 +00:00
m.insert(".gitattributes", "\u{f1d3}"); // ""
2018-12-14 15:43:05 +00:00
m.insert(".gitconfig", "\u{f1d3}"); // ""
2018-12-13 15:50:47 +00:00
m.insert(".github", "\u{f408}"); // ""
2018-12-14 15:43:05 +00:00
m.insert(".gitignore", "\u{f1d3}"); // ""
2019-07-31 08:58:10 +00:00
m.insert(".gitmodules", "\u{f1d3}"); // ""
2018-12-13 15:50:47 +00:00
m.insert(".rvm", "\u{e21e}"); // ""
2018-12-14 15:43:05 +00:00
m.insert(".vimrc", "\u{e62b}"); // ""
2018-12-13 15:50:47 +00:00
m.insert(".vscode", "\u{e70c}"); // ""
2018-12-14 15:43:05 +00:00
m.insert(".zshrc", "\u{f489}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("bin", "\u{e5fc}"); // ""
m.insert("config", "\u{e5fc}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("docker-compose.yml", "\u{f308}"); // ""
m.insert("dockerfile", "\u{f308}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("ds_store", "\u{f179}"); // ""
m.insert("gitignore_global", "\u{f1d3}"); // ""
m.insert("gradle", "\u{e70e}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("gruntfile.coffee", "\u{e611}"); // ""
m.insert("gruntfile.js", "\u{e611}"); // ""
m.insert("gruntfile.ls", "\u{e611}"); // ""
m.insert("gulpfile.coffee", "\u{e610}"); // ""
m.insert("gulpfile.js", "\u{e610}"); // ""
m.insert("gulpfile.ls", "\u{e610}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("hidden", "\u{f023}"); // ""
m.insert("include", "\u{e5fc}"); // ""
m.insert("lib", "\u{f121}"); // ""
m.insert("localized", "\u{f179}"); // ""
m.insert("node_modules", "\u{e718}"); // ""
m.insert("npmignore", "\u{e71e}"); // ""
m.insert("rubydoc", "\u{e73b}"); // ""
m
2018-12-08 18:52:56 +00:00
}
2018-12-08 18:52:56 +00:00
fn get_default_icons_by_extension() -> HashMap<&'static str, &'static str> {
let mut m = HashMap::new();
2018-12-13 15:50:47 +00:00
m.insert("apk", "\u{e70e}"); // ""
m.insert("apk", "\u{e70e}"); // ""
m.insert("avi", "\u{f03d}"); // ""
m.insert("avro", "\u{e60b}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("awk", "\u{f489}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("bash", "\u{f489}"); // ""
m.insert("bash_history", "\u{f489}"); // ""
m.insert("bash_profile", "\u{f489}"); // ""
m.insert("bashrc", "\u{f489}"); // ""
m.insert("bat", "\u{f17a}"); // ""
m.insert("bio", "\u{f910}"); // "蘿"
2018-12-13 15:50:47 +00:00
m.insert("bmp", "\u{f1c5}"); // ""
m.insert("c", "\u{e61e}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("c++", "\u{e61d}"); // ""
m.insert("cc", "\u{e61d}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("cfg", "\u{e615}"); // ""
m.insert("clj", "\u{e768}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("cljs", "\u{e76a}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("cls", "\u{e600}"); // ""
m.insert("coffee", "\u{f0f4}"); // ""
m.insert("conf", "\u{e615}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("cp", "\u{e61d}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("cpp", "\u{e61d}"); // ""
2020-01-21 13:52:09 +00:00
m.insert("cs", "\u{f81a}"); // ""
m.insert("cshtml", "\u{f1fa}"); // ""
m.insert("csproj", "\u{f81a}"); // ""
m.insert("csx", "\u{f81a}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("csh", "\u{f489}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("css", "\u{e749}"); // ""
m.insert("csv", "\u{f1c3}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("cxx", "\u{e61d}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("d", "\u{e7af}"); // ""
m.insert("dart", "\u{e798}"); // ""
m.insert("db", "\u{f1c0}"); // ""
m.insert("diff", "\u{f440}"); // ""
m.insert("doc", "\u{f1c2}"); // ""
m.insert("docx", "\u{f1c2}"); // ""
m.insert("ds_store", "\u{f179}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("dump", "\u{f1c0}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("ebook", "\u{e28b}"); // ""
m.insert("editorconfig", "\u{e615}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("ejs", "\u{e618}"); // ""
2019-11-01 09:04:15 +00:00
m.insert("elm", "\u{e62c}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("env", "\u{f462}"); // ""
m.insert("eot", "\u{f031}"); // ""
m.insert("epub", "\u{e28a}"); // ""
m.insert("erb", "\u{e73b}"); // ""
m.insert("erl", "\u{e7b1}"); // ""
m.insert("exe", "\u{f17a}"); // ""
2019-10-27 17:36:22 +00:00
m.insert("ex", "\u{e62d}"); // ""
m.insert("exs", "\u{e62d}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("fish", "\u{f489}"); // ""
m.insert("flac", "\u{f001}"); // ""
m.insert("flv", "\u{f03d}"); // ""
m.insert("font", "\u{f031}"); // ""
m.insert("fpl", "\u{f910}"); // "蘿"
2018-12-13 15:50:47 +00:00
m.insert("gdoc", "\u{f1c2}"); // ""
m.insert("gemfile", "\u{e21e}"); // ""
m.insert("gemspec", "\u{e21e}"); // ""
m.insert("gform", "\u{f298}"); // ""
m.insert("gif", "\u{f1c5}"); // ""
m.insert("git", "\u{f1d3}"); // ""
m.insert("go", "\u{e626}"); // ""
m.insert("gradle", "\u{e70e}"); // ""
m.insert("gsheet", "\u{f1c3}"); // ""
m.insert("gslides", "\u{f1c4}"); // ""
m.insert("guardfile", "\u{e21e}"); // ""
m.insert("gz", "\u{f410}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("h", "\u{f0fd}"); // ""
m.insert("hbs", "\u{e60f}"); // ""
m.insert("hpp", "\u{f0fd}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("hs", "\u{e777}"); // ""
m.insert("htm", "\u{f13b}"); // ""
m.insert("html", "\u{f13b}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("hxx", "\u{f0fd}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("ico", "\u{f1c5}"); // ""
m.insert("image", "\u{f1c5}"); // ""
m.insert("iml", "\u{e7b5}"); // ""
m.insert("ini", "\u{e615}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("ipynb", "\u{e606}"); // ""
m.insert("jar", "\u{e204}"); // ""
m.insert("java", "\u{e204}"); // ""
m.insert("jpeg", "\u{f1c5}"); // ""
m.insert("jpg", "\u{f1c5}"); // ""
m.insert("js", "\u{e74e}"); // ""
m.insert("json", "\u{e60b}"); // ""
m.insert("jsx", "\u{e7ba}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("ksh", "\u{f489}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("less", "\u{e758}"); // ""
m.insert("lhs", "\u{e777}"); // ""
m.insert("license", "\u{f48a}"); // ""
m.insert("localized", "\u{f179}"); // ""
2020-05-01 15:56:20 +00:00
m.insert("lock", "\u{f023}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("log", "\u{f18d}"); // ""
m.insert("lua", "\u{e620}"); // ""
m.insert("m3u", "\u{f910}"); // "蘿"
m.insert("m3u8", "\u{f910}"); // "蘿"
2018-12-13 15:50:47 +00:00
m.insert("m4a", "\u{f001}"); // ""
m.insert("markdown", "\u{f48a}"); // ""
m.insert("md", "\u{f48a}"); // ""
m.insert("mkd", "\u{f48a}"); // ""
m.insert("mkv", "\u{f03d}"); // ""
m.insert("mobi", "\u{e28b}"); // ""
m.insert("mov", "\u{f03d}"); // ""
m.insert("mp3", "\u{f001}"); // ""
m.insert("mp4", "\u{f03d}"); // ""
m.insert("mustache", "\u{e60f}"); // ""
m.insert("npmignore", "\u{e71e}"); // ""
2020-06-01 16:22:56 +00:00
m.insert("opus", "\u{f001}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("ogg", "\u{f001}"); // ""
m.insert("ogv", "\u{f03d}"); // ""
m.insert("otf", "\u{f031}"); // ""
m.insert("pdf", "\u{f1c1}"); // ""
m.insert("php", "\u{e73d}"); // ""
m.insert("pl", "\u{e769}"); // ""
m.insert("pls", "\u{f910}"); // "蘿"
2018-12-13 15:50:47 +00:00
m.insert("png", "\u{f1c5}"); // ""
m.insert("ppt", "\u{f1c4}"); // ""
m.insert("pptx", "\u{f1c4}"); // ""
m.insert("procfile", "\u{e21e}"); // ""
m.insert("properties", "\u{e60b}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("ps1", "\u{f489}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("psd", "\u{e7b8}"); // ""
m.insert("pxm", "\u{f1c5}"); // ""
m.insert("py", "\u{e606}"); // ""
m.insert("pyc", "\u{e606}"); // ""
m.insert("r", "\u{f25d}"); // ""
m.insert("rakefile", "\u{e21e}"); // ""
m.insert("rar", "\u{f410}"); // ""
2020-01-21 13:52:09 +00:00
m.insert("razor", "\u{f1fa}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("rb", "\u{e21e}"); // ""
m.insert("rdata", "\u{f25d}"); // ""
m.insert("rdb", "\u{e76d}"); // ""
m.insert("rdoc", "\u{f48a}"); // ""
m.insert("rds", "\u{f25d}"); // ""
m.insert("readme", "\u{f48a}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("rlib", "\u{e7a8}"); // ""
m.insert("rmd", "\u{f48a}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("rs", "\u{e7a8}"); // ""
m.insert("rspec", "\u{e21e}"); // ""
m.insert("rspec_parallel", "\u{e21e}"); // ""
m.insert("rspec_status", "\u{e21e}"); // ""
m.insert("rss", "\u{f09e}"); // ""
m.insert("ru", "\u{e21e}"); // ""
m.insert("rubydoc", "\u{e73b}"); // ""
m.insert("sass", "\u{e603}"); // ""
m.insert("scala", "\u{e737}"); // ""
m.insert("scss", "\u{e749}"); // ""
m.insert("sh", "\u{f489}"); // ""
m.insert("shell", "\u{f489}"); // ""
m.insert("slim", "\u{e73b}"); // ""
2020-01-21 13:52:09 +00:00
m.insert("sln", "\u{e70c}"); // ""
2018-12-14 15:43:05 +00:00
m.insert("sql", "\u{f1c0}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("sqlite3", "\u{e7c4}"); // ""
m.insert("styl", "\u{e600}"); // ""
m.insert("stylus", "\u{e600}"); // ""
m.insert("svg", "\u{f1c5}"); // ""
m.insert("swift", "\u{e755}"); // ""
m.insert("tar", "\u{f410}"); // ""
m.insert("tex", "\u{e600}"); // ""
m.insert("tiff", "\u{f1c5}"); // ""
m.insert("ts", "\u{e628}"); // ""
m.insert("tsx", "\u{e7ba}"); // ""
m.insert("ttf", "\u{f031}"); // ""
m.insert("twig", "\u{e61c}"); // ""
m.insert("txt", "\u{f15c}"); // ""
m.insert("video", "\u{f03d}"); // ""
m.insert("vim", "\u{e62b}"); // ""
m.insert("vlc", "\u{f910}"); // "蘿"
2018-12-14 15:43:05 +00:00
m.insert("vue", "\u{fd42}"); // "﵂"
2018-12-13 15:50:47 +00:00
m.insert("wav", "\u{f001}"); // ""
m.insert("webm", "\u{f03d}"); // ""
m.insert("webp", "\u{f1c5}"); // ""
m.insert("windows", "\u{f17a}"); // ""
m.insert("wma", "\u{f001}"); // ""
m.insert("wmv", "\u{f03d}"); // ""
m.insert("wpl", "\u{f910}"); // "蘿"
2018-12-13 15:50:47 +00:00
m.insert("woff", "\u{f031}"); // ""
m.insert("woff2", "\u{f031}"); // ""
m.insert("xls", "\u{f1c3}"); // ""
m.insert("xlsx", "\u{f1c3}"); // ""
m.insert("xml", "\u{e619}"); // ""
m.insert("xul", "\u{e619}"); // ""
2020-05-12 12:46:39 +00:00
m.insert("yaml", "\u{e60b}"); // ""
m.insert("yml", "\u{e60b}"); // ""
2020-05-12 12:46:39 +00:00
m.insert("zip", "\u{f410}"); // ""
2018-12-13 15:50:47 +00:00
m.insert("zsh", "\u{f489}"); // ""
m.insert("zsh-theme", "\u{f489}"); // ""
m.insert("zshrc", "\u{f489}"); // ""
m
}
}
2018-12-23 05:12:26 +00:00
2019-02-04 21:58:15 +00:00
#[cfg(test)]
2018-12-23 05:12:26 +00:00
mod test {
use super::{Icons, Theme, ICON_SPACE};
2019-02-04 21:58:15 +00:00
use crate::meta::Meta;
2018-12-23 05:12:26 +00:00
use std::fs::File;
use tempfile::tempdir;
2018-12-23 05:12:26 +00:00
#[test]
fn get_no_icon() {
let tmp_dir = tempdir().expect("failed to create temp dir");
2018-12-23 05:12:26 +00:00
let file_path = tmp_dir.path().join("file.txt");
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
2018-12-23 05:12:26 +00:00
let icon = Icons::new(Theme::NoIcon);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2018-12-23 05:12:26 +00:00
assert_eq!(icon, "");
}
#[test]
fn get_default_file_icon() {
let tmp_dir = tempdir().expect("failed to create temp dir");
2018-12-23 05:12:26 +00:00
let file_path = tmp_dir.path().join("file");
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
2018-12-23 05:12:26 +00:00
let icon = Icons::new(Theme::Fancy);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2018-12-23 05:12:26 +00:00
assert_eq!(icon, format!("{}{}", "\u{f016}", ICON_SPACE)); // 
2018-12-23 05:12:26 +00:00
}
#[test]
fn get_default_file_icon_unicode() {
let tmp_dir = tempdir().expect("failed to create temp dir");
let file_path = tmp_dir.path().join("file");
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
let icon = Icons::new(Theme::Unicode);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2019-01-18 17:17:11 +00:00
assert_eq!(icon, format!("{}{}", "\u{1f5cb}", ICON_SPACE));
}
2018-12-23 05:12:26 +00:00
#[test]
fn get_directory_icon() {
let tmp_dir = tempdir().expect("failed to create temp dir");
2018-12-23 05:12:26 +00:00
let file_path = tmp_dir.path();
let meta = Meta::from_path(&file_path.to_path_buf(), false).unwrap();
2018-12-23 05:12:26 +00:00
let icon = Icons::new(Theme::Fancy);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2018-12-23 05:12:26 +00:00
assert_eq!(icon, format!("{}{}", "\u{f115}", ICON_SPACE)); // 
2018-12-23 05:12:26 +00:00
}
#[test]
fn get_directory_icon_unicode() {
let tmp_dir = tempdir().expect("failed to create temp dir");
let file_path = tmp_dir.path();
let meta = Meta::from_path(&file_path.to_path_buf(), false).unwrap();
let icon = Icons::new(Theme::Unicode);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2019-01-18 17:17:11 +00:00
assert_eq!(icon, format!("{}{}", "\u{1f5c1}", ICON_SPACE));
}
2018-12-23 05:12:26 +00:00
#[test]
fn get_directory_icon_with_ext() {
let tmp_dir = tempdir().expect("failed to create temp dir");
2018-12-23 05:12:26 +00:00
let file_path = tmp_dir.path();
let meta = Meta::from_path(&file_path.to_path_buf(), false).unwrap();
2018-12-23 05:12:26 +00:00
let icon = Icons::new(Theme::Fancy);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2018-12-23 05:12:26 +00:00
assert_eq!(icon, format!("{}{}", "\u{f115}", ICON_SPACE)); // 
2018-12-23 05:12:26 +00:00
}
#[test]
fn get_icon_by_name() {
let tmp_dir = tempdir().expect("failed to create temp dir");
2018-12-23 05:12:26 +00:00
for (file_name, file_icon) in &Icons::get_default_icons_by_name() {
let file_path = tmp_dir.path().join(file_name);
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
2018-12-23 05:12:26 +00:00
let icon = Icons::new(Theme::Fancy);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2018-12-23 05:12:26 +00:00
assert_eq!(icon, format!("{}{}", file_icon, ICON_SPACE));
}
}
#[test]
fn get_icon_by_extension() {
let tmp_dir = tempdir().expect("failed to create temp dir");
2018-12-23 05:12:26 +00:00
for (ext, file_icon) in &Icons::get_default_icons_by_extension() {
let file_path = tmp_dir.path().join(format!("file.{}", ext));
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
2018-12-23 05:12:26 +00:00
let icon = Icons::new(Theme::Fancy);
2019-02-04 21:58:15 +00:00
let icon = icon.get(&meta.name);
2018-12-23 05:12:26 +00:00
assert_eq!(icon, format!("{}{}", file_icon, ICON_SPACE));
}
}
}