MCPcopy Create free account
hub / github.com/PerroEngine/Perro / display_kind_label

Function display_kind_label

perro_editor/res/scripts/assets/editor_files.rs:51–74  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

49}
50
51pub fn display_kind_label(path: &str) -> &'static str {
52 if path.ends_with('/') {
53 return "DIR";
54 }
55 let Some(ext) = Path::new(path).extension().and_then(|v| v.to_str()) else {
56 return "OTH";
57 };
58 match ext.to_ascii_lowercase().as_str() {
59 "scn" | "fur" => "SCN",
60 "rs" => "RS",
61 "png" | "jpg" | "jpeg" | "webp" | "bmp" | "tga" => "IMG",
62 "wav" | "ogg" | "mp3" | "flac" | "aac" | "m4a" | "mid" | "midi" | "sf2" => "AUD",
63 "panim" => "ANIM",
64 "panimtree" => "TREE",
65 "pmat" => "MAT",
66 "uistyle" => "STYLE",
67 "ppart" => "PART",
68 "ptileset" => "TILE",
69 "pskel2d" | "pskel3d" => "SKEL",
70 "glb" | "gltf" => "GLB",
71 "obj" | "fbx" | "pmesh" => "MESH",
72 _ => "OTH",
73 }
74}

Callers 1

file_path_has_tagFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected