specific_file/specific_file.rs
1use std::path::Path;
2
3use freedesktop_desktop_entry::DesktopEntry;
4
5fn main() {
6 let path = Path::new("tests_entries/org.mozilla.firefox.desktop");
7 let locales = &["fr_FR", "en", "it"];
8
9 // if let Ok(bytes) = fs::read_to_string(path) {
10 // if let Ok(entry) = DesktopEntry::decode_from_str(path, &bytes, locales) {
11 // println!("{}\n---\n{}", path.display(), entry);
12 // }
13 // }
14
15 if let Ok(entry) = DesktopEntry::from_path(path.to_path_buf(), Some(locales)) {
16 println!("{}\n---\n{}", path.display(), entry);
17 }
18}