1pub struct PathFileType {
5 pub icon: &'static str,
6 pub md_lang: &'static str,
7}
8pub const DIR_ICON: &str = "📂";
10
11pub fn get_file_type(ext: &str) -> PathFileType {
14 match ext {
15 "rs" => PathFileType { icon: "🦀", md_lang: "rust" },
16 "toml" => PathFileType { icon: "⚙️", md_lang: "toml" },
17 "slint" => PathFileType { icon: "🎨", md_lang: "slint" },
18 "md" => PathFileType { icon: "📝", md_lang: "markdown" },
19 "json" => PathFileType { icon: "🔣", md_lang: "json" },
20 "yaml" | "yml" => PathFileType { icon: "🛠️", md_lang: "yaml" },
21 "html" => PathFileType { icon: "🌐", md_lang: "html" },
22 "css" => PathFileType { icon: "🖌️", md_lang: "css" },
23 "js" => PathFileType { icon: "📜", md_lang: "javascript" },
24 "ts" => PathFileType { icon: "📘", md_lang: "typescript" },
25 _ => PathFileType { icon: "📄", md_lang: "text" }, }
27}