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 {
16 icon: "🦀",
17 md_lang: "rust",
18 },
19 "toml" => PathFileType {
20 icon: "⚙️",
21 md_lang: "toml",
22 },
23 "slint" => PathFileType {
24 icon: "🎨",
25 md_lang: "slint",
26 },
27 "md" => PathFileType {
28 icon: "📝",
29 md_lang: "markdown",
30 },
31 "json" => PathFileType {
32 icon: "🔣",
33 md_lang: "json",
34 },
35 "yaml" | "yml" => PathFileType {
36 icon: "🛠️",
37 md_lang: "yaml",
38 },
39 "html" => PathFileType {
40 icon: "🌐",
41 md_lang: "html",
42 },
43 "css" => PathFileType {
44 icon: "🖌️",
45 md_lang: "css",
46 },
47 "js" => PathFileType {
48 icon: "📜",
49 md_lang: "javascript",
50 },
51 "ts" => PathFileType {
52 icon: "📘",
53 md_lang: "typescript",
54 },
55 _ => PathFileType {
56 icon: "📄",
57 md_lang: "text",
58 }, }
60}