Skip to content

Commit b664549

Browse files
committed
chore: Update README
1 parent a72469e commit b664549

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
# Freedesktop Desktop Entry Specification
22

3-
This crate provides a library for efficiently fetching, parsing, and generating [Desktop Entry](https://specifications.freedesktop.org/desktop-entry-spec/latest/index.html) files.
3+
This crate provides a library for efficiently parsing [Desktop Entry](https://specifications.freedesktop.org/desktop-entry-spec/latest/index.html) files.
4+
5+
```rust
6+
use std::fs;
7+
8+
use freedesktop_desktop_entry::{default_paths, DesktopEntry, Iter};
9+
10+
fn main() {
11+
for (path_src, path) in Iter::new(default_paths()) {
12+
if let Ok(bytes) = fs::read_to_string(&path) {
13+
if let Ok(entry) = DesktopEntry::decode(&path, &bytes) {
14+
println!("{:?}: {}\n---\n{}", path_src, path.display(), entry);
15+
}
16+
}
17+
}
18+
}
19+
```

0 commit comments

Comments
 (0)