Skip to content

Commit

Permalink
udevrs fixes integrated; hwdb lookup working
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna-f1sh committed Jun 21, 2024
1 parent fa9416b commit da67cb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "List system USB buses and devices; a modern cross-platform `lsusb
repository = "https://github.com/tuna-f1sh/cyme"
readme = "README.md"
license = "GPL-3.0-or-later"
version = "1.6.1"
version = "1.7.0"
edition = "2021"
keywords = ["usb", "lsusb", "system_profiler", "macos", "libusb"]
categories = ["command-line-utilities"]
Expand Down
11 changes: 1 addition & 10 deletions src/udev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,7 @@ pub mod hwdb {
)
})?;

hwdb.get_properties_list_entry(&modalias.to_string(), 0)
.map(|mut entry| entry
.find(|entry| entry.name() == key)
.map(|entry| entry.value().to_owned())
).map_err(|e| {
Error::new(
ErrorKind::Udev,
&format!("Failed to get hwdb modalias/key {}/{}: Error({})", modalias, key, e),
)
})
Ok(udevrs::udev_hwdb_query_one(&mut hwdb, modalias, key).map(|s| s.trim().to_string()))
}
}

Expand Down

0 comments on commit da67cb1

Please sign in to comment.