Skip to content

Commit fe38b62

Browse files
committed
style: fix clippy tips
1 parent 7bd5e22 commit fe38b62

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

evdev/src/main/rust/evdev_manager/core/src/android/keylayout/key_layout_map.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ impl fmt::Debug for KeyLayoutMap {
115115

116116
// Show a sample of axes (first 5) if there are any
117117
if !self.axes.is_empty() {
118-
let sample_axes: Vec<_> = self
119-
.axes
120-
.iter()
121-
.take(5)
122-
.map(|(scan_code, axis_info)| (scan_code, axis_info))
123-
.collect();
118+
let sample_axes: Vec<_> = self.axes.iter().take(5).collect();
124119
debug_struct.field("sample_axes", &sample_axes);
125120
}
126121

evdev/src/main/rust/evdev_manager/core/src/android/keylayout/key_layout_map_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl KeyLayoutFileFinder for AndroidKeyLayoutFileFinder {
248248

249249
match fs::metadata(&path) {
250250
Ok(metadata) if metadata.is_file() => {
251-
if let Ok(_) = File::open(&path) {
251+
if File::open(&path).is_ok() {
252252
return Some(path);
253253
}
254254
}

evdev/src/main/rust/evdev_manager/core/src/event_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl EventLoopManager {
350350
device
351351
.uinput
352352
.write_event(EventType::EV_KEY as c_uint, code, value)
353-
.map_err(|err| EvdevError::from(err))?;
353+
.map_err(EvdevError::from)?;
354354

355355
// Send SYN_REPORT
356356
device
@@ -388,7 +388,7 @@ impl EventLoopManager {
388388
device
389389
.uinput
390390
.write_event(EventType::EV_KEY as c_uint, code, value)
391-
.map_err(|err| EvdevError::from(err))?;
391+
.map_err(EvdevError::from)?;
392392

393393
// Send SYN_REPORT
394394
device

0 commit comments

Comments
 (0)