Fixup Display output to unwrap name
This commit is contained in:
parent
a55f319854
commit
7da53b57fe
2 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ fn main() {
|
|||
} else {
|
||||
let mut devices = evdev::enumerate().collect::<Vec<_>>();
|
||||
for (i, d) in devices.iter().enumerate() {
|
||||
println!("{}: {:?}", i, d.name());
|
||||
println!("{}: {}", i, d.name().unwrap_or("Unnamed device"));
|
||||
}
|
||||
print!("Select the device [0-{}]: ", devices.len());
|
||||
let _ = std::io::stdout().flush();
|
||||
|
|
|
@ -222,7 +222,7 @@ const fn bus_name(x: u16) -> &'static str {
|
|||
|
||||
impl std::fmt::Display for Device {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
writeln!(f, "{:?}", self.name)?;
|
||||
writeln!(f, "{}", self.name.as_deref().unwrap_or("Unnamed device"))?;
|
||||
writeln!(
|
||||
f,
|
||||
" Driver version: {}.{}.{}",
|
||||
|
|
Loading…
Reference in a new issue