diff --git a/device/src/u3v/async_read.rs b/device/src/u3v/async_read.rs index 921dbd02..383388ed 100644 --- a/device/src/u3v/async_read.rs +++ b/device/src/u3v/async_read.rs @@ -233,6 +233,8 @@ fn poll_completed( let remaining = deadline.saturating_duration_since(Instant::now()); let timeval = libc::timeval { tv_sec: remaining.as_secs().try_into().unwrap(), + // tv_usec is i64 on Linux (with infallible conversion from u32), but i32 on Mac. + #[allow(clippy::unnecessary_fallible_conversions)] tv_usec: remaining.subsec_micros().try_into().unwrap(), }; diff --git a/gentl/src/ffi/port.rs b/gentl/src/ffi/port.rs index 99197f4a..3164242c 100644 --- a/gentl/src/ffi/port.rs +++ b/gentl/src/ffi/port.rs @@ -232,7 +232,7 @@ gentl_api! { let handle = unsafe { ModuleHandle::from_raw_manually_drop(hPort)? }; let url = with_port!(handle, |port| { // Use first info. - let xml_info = port.xml_infos()?.get(0).ok_or_else(|| GenTlError::Error("no xml information in the device".into()))?; + let xml_info = port.xml_infos()?.first().ok_or_else(|| GenTlError::Error("no xml information in the device".into()))?; file_location_to_url(xml_info, port.port_info()?) });