(path: &str)
| 49 | } |
| 50 | |
| 51 | pub 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 | } |
no test coverage detected