Skip to content

Commit

Permalink
clippy 1.79 lints
Browse files Browse the repository at this point in the history
  • Loading branch information
warthog618 committed Mar 22, 2024
1 parent 48782ee commit df5134e
Show file tree
Hide file tree
Showing 34 changed files with 3 additions and 35 deletions.
1 change: 0 additions & 1 deletion embedded-hal/examples/async_io_wait_for_edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use embedded_hal_async::digital::Wait;
use gpiocdev_embedded_hal::async_io::InputPin;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut pin = InputPin::new("/dev/gpiochip0", 23).context("Failed to request line")?;
Expand Down
1 change: 0 additions & 1 deletion embedded-hal/examples/async_std_wait_for_edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use embedded_hal_async::digital::Wait;
use gpiocdev_embedded_hal::async_io::InputPin;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut pin = InputPin::new("/dev/gpiochip0", 23).context("Failed to request line")?;
Expand Down
1 change: 0 additions & 1 deletion embedded-hal/examples/get_pin_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Basic example of reading a single line.

use embedded_hal::digital::InputPin;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut pin = gpiocdev_embedded_hal::InputPin::new("/dev/gpiochip0", 22)?;
Expand Down
1 change: 0 additions & 1 deletion embedded-hal/examples/pulse_pin_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Basic example of pulsing a single line.

use embedded_hal::digital::{OutputPin, PinState};
use std::result::Result;
use std::thread;
use std::time::Duration;

Expand Down
1 change: 0 additions & 1 deletion embedded-hal/examples/toggle_pin_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Basic example of toggling a single line.

use embedded_hal::digital::{PinState, StatefulOutputPin};
use std::result::Result;
use std::thread;
use std::time::Duration;

Expand Down
1 change: 0 additions & 1 deletion embedded-hal/examples/tokio_wait_for_edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use embedded_hal_async::digital::Wait;
use gpiocdev_embedded_hal::tokio::InputPin;
use std::result::Result;

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
1 change: 0 additions & 1 deletion embedded-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
//! # Ok(())
//! # }
//! ```
use std::convert::TryFrom;
use std::path::Path;

use embedded_hal::digital::PinState;
Expand Down
1 change: 0 additions & 1 deletion lib/examples/async_io_watch_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use anyhow::Context;
use gpiocdev::async_io::AsyncRequest;
use gpiocdev::line::EdgeDetection;
use gpiocdev::Request;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let req = AsyncRequest::new(
Expand Down
1 change: 0 additions & 1 deletion lib/examples/async_std_watch_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use anyhow::Context;
use gpiocdev::async_io::AsyncRequest;
use gpiocdev::line::EdgeDetection;
use gpiocdev::Request;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let offset = 23;
Expand Down
1 change: 0 additions & 1 deletion lib/examples/get_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use gpiocdev::line::Bias;
use gpiocdev::Request;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let offset = 22;
Expand Down
1 change: 0 additions & 1 deletion lib/examples/get_multiple_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use gpiocdev::line::Values;
use gpiocdev::Request;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
// request multiple input lines
Expand Down
1 change: 0 additions & 1 deletion lib/examples/pulse_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use gpiocdev::line::Value;
use gpiocdev::Request;
use std::result::Result;
use std::thread;
use std::time::Duration;

Expand Down
1 change: 0 additions & 1 deletion lib/examples/pulse_multiple_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use gpiocdev::line::{Value, Values};
use gpiocdev::Request;
use std::result::Result;
use std::time::Duration;

fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
1 change: 0 additions & 1 deletion lib/examples/toggle_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use gpiocdev::line::Value;
use gpiocdev::Request;
use std::result::Result;
use std::time::Duration;

fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
1 change: 0 additions & 1 deletion lib/examples/toggle_multiple_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use gpiocdev::line::Value;
use gpiocdev::Request;
use std::result::Result;
use std::thread;
use std::time::Duration;

Expand Down
1 change: 0 additions & 1 deletion lib/examples/tokio_watch_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use anyhow::Context;
use gpiocdev::line::{EdgeDetection, Values};
use gpiocdev::tokio::AsyncRequest;
use gpiocdev::Request;
use std::result::Result;

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
1 change: 0 additions & 1 deletion lib/examples/watch_line_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use gpiocdev::line::EdgeDetection;
use gpiocdev::Request;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
// request the line with edge detection to receive events
Expand Down
1 change: 0 additions & 1 deletion lib/examples/watch_multiple_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use anyhow::Context;
use gpiocdev::line::EdgeDetection;
use gpiocdev::Request;
use std::result::Result;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let offsets = [23, 12];
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ mod chip {
use gpiocdev::chip::Chip;
use gpiocdev::request::Request;
use gpiocdev::Error::GpioChip as ChipError;
use gpiosim::{Bank, Direction, Simpleton};
use gpiosim::{Direction, Simpleton};
use std::time::Duration;

// a collection of chips with named and hogged lines for find and info tests
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn find_named_lines() {
assert_eq!(&l.chip, sim.chips()[1].dev_path());
assert_eq!(l.info.offset, 5);
}
assert!(found.get(&"fls nada").is_none());
assert!(found.contains_key(&"fls nada"));
}

#[test]
Expand Down
3 changes: 1 addition & 2 deletions uapi/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

use libc::{self, c_long, pollfd, time_t, timespec, POLLIN};
use libc::{c_long, pollfd, time_t, timespec, POLLIN};
use std::ffi::OsStr;
use std::fs::File;
use std::mem::{self, MaybeUninit};
Expand All @@ -25,7 +25,6 @@ macro_rules! ior {
ioctl_sys::ior!(IOCTL_MAGIC, $nr, mem::size_of::<$dty>()) as ::std::os::raw::c_ulong
};
}
pub(crate) use ior;

macro_rules! iorw {
($nr:expr, $dty:ty) => {
Expand Down
1 change: 0 additions & 1 deletion uapi/src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use bitflags::bitflags;
use std::convert::TryFrom;
use std::fmt;
use std::fs::File;
use std::mem;
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v1/get_chip_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use super::*;
use gpiocdev_uapi::v1::get_chip_info;
#[test]
fn check_info() {
let s = gpiosim::builder()
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v1/get_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::wait_propagation_delay;
use gpiocdev_uapi::v1::{get_line_values, set_line_values};

#[test]
fn on_input() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v1/set_line_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use super::*;
use gpiocdev_uapi::v1::{set_line_config, HandleConfig};

#[test]
fn check_info() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v1/set_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::wait_propagation_delay;
use gpiocdev_uapi::v1::set_line_values;

#[test]
fn on_output() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v1/unwatch_line_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::EVENT_WAIT_TIMEOUT;
use gpiocdev_uapi::v1::{unwatch_line_info, wait_event, watch_line_info};

#[test]
fn unwatch() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v1/watch_line_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::EVENT_WAIT_TIMEOUT;
use gpiocdev_uapi::v1::{wait_event, watch_line_info};

#[test]
fn watch() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v2/get_line_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use super::*;
use gpiocdev_uapi::v2::{get_line_info, LineFlags};

#[test]
fn check_info() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v2/get_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::wait_propagation_delay;
use gpiocdev_uapi::v2::{get_line_values, set_line_values};

#[test]
fn on_input() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v2/set_line_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use super::*;
use gpiocdev_uapi::v2::{set_line_config, LineConfig};

#[test]
fn check_info() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v2/set_line_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use super::*;

use crate::common::wait_propagation_delay;
use gpiocdev_uapi::v2::set_line_values;

#[test]
fn on_output() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v2/unwatch_line_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::EVENT_WAIT_TIMEOUT;
use gpiocdev_uapi::v2::{unwatch_line_info, wait_event, watch_line_info};

#[test]
fn unwatch() {
Expand Down
1 change: 0 additions & 1 deletion uapi/tests/v2/watch_line_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use super::*;
use crate::common::EVENT_WAIT_TIMEOUT;
use gpiocdev_uapi::v2::{wait_event, watch_line_info};

#[test]
fn watch() {
Expand Down

0 comments on commit df5134e

Please sign in to comment.