Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy 1.75 warnings #181

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions device/src/u3v/async_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};

Expand Down
2 changes: 1 addition & 1 deletion gentl/src/ffi/port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?)
});

Expand Down
Loading