Skip to content

Commit 973c5ad

Browse files
authored
chore(readme): Fix sample code
1 parent fb6dff1 commit 973c5ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ This crate provides a library for efficiently parsing [Desktop Entry](https://sp
55
```rust
66
use std::fs;
77

8-
use freedesktop_desktop_entry::{default_paths, DesktopEntry, Iter};
8+
use freedesktop_desktop_entry::{default_paths, DesktopEntry, Iter, PathSource};
99

1010
fn main() {
11-
for (path_src, path) in Iter::new(default_paths()) {
11+
for path in Iter::new(default_paths()) {
12+
let path_src = PathSource::guess_from(&path);
1213
if let Ok(bytes) = fs::read_to_string(&path) {
1314
if let Ok(entry) = DesktopEntry::decode(&path, &bytes) {
1415
println!("{:?}: {}\n---\n{}", path_src, path.display(), entry);
@@ -29,4 +30,4 @@ Any contribution intentionally submitted for inclusion in the work by you shall
2930
```rs
3031
// Copyright {year} {person OR org} <{email}>
3132
// SPDX-License-Identifier: MPL-2.0
32-
```
33+
```

0 commit comments

Comments
 (0)