Align code to follow what 'cargo fmt' suggests. Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx> --- bindings/rust/gpiosim-sys/src/lib.rs | 13 +++++++------ bindings/rust/libgpiod/src/chip.rs | 5 ++--- bindings/rust/libgpiod/src/lib.rs | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bindings/rust/gpiosim-sys/src/lib.rs b/bindings/rust/gpiosim-sys/src/lib.rs index c3f5b3fb9fd4..e3630442e24b 100644 --- a/bindings/rust/gpiosim-sys/src/lib.rs +++ b/bindings/rust/gpiosim-sys/src/lib.rs @@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2022 Linaro Ltd. // SPDX-FileCopyrightTest: 2022 Viresh Kumar <viresh.kumar@xxxxxxxxxx> -use libgpiod::{Error, Result, OperationType}; +use libgpiod::{Error, OperationType, Result}; #[allow(non_camel_case_types, non_upper_case_globals)] #[cfg_attr(test, allow(deref_nullptr, non_snake_case))] @@ -16,14 +16,14 @@ mod sim; pub use sim::*; use crate::{ - gpiosim_value_GPIOSIM_VALUE_INACTIVE as GPIOSIM_VALUE_INACTIVE, - gpiosim_value_GPIOSIM_VALUE_ACTIVE as GPIOSIM_VALUE_ACTIVE, - gpiosim_value_GPIOSIM_VALUE_ERROR as GPIOSIM_VALUE_ERROR, gpiosim_direction_GPIOSIM_DIRECTION_INPUT as GPIOSIM_DIRECTION_INPUT, gpiosim_direction_GPIOSIM_DIRECTION_OUTPUT_HIGH as GPIOSIM_DIRECTION_OUTPUT_HIGH, gpiosim_direction_GPIOSIM_DIRECTION_OUTPUT_LOW as GPIOSIM_DIRECTION_OUTPUT_LOW, - gpiosim_pull_GPIOSIM_PULL_UP as GPIOSIM_PULL_UP, gpiosim_pull_GPIOSIM_PULL_DOWN as GPIOSIM_PULL_DOWN, + gpiosim_pull_GPIOSIM_PULL_UP as GPIOSIM_PULL_UP, + gpiosim_value_GPIOSIM_VALUE_ACTIVE as GPIOSIM_VALUE_ACTIVE, + gpiosim_value_GPIOSIM_VALUE_ERROR as GPIOSIM_VALUE_ERROR, + gpiosim_value_GPIOSIM_VALUE_INACTIVE as GPIOSIM_VALUE_INACTIVE, }; /// Value settings. @@ -42,7 +42,8 @@ impl Value { GPIOSIM_VALUE_ACTIVE => Value::Active, GPIOSIM_VALUE_ERROR => { return Err(Error::OperationFailed( - OperationType::SimBankGetVal, errno::errno() + OperationType::SimBankGetVal, + errno::errno(), )) } _ => return Err(Error::InvalidEnumValue("Value", val as i32)), diff --git a/bindings/rust/libgpiod/src/chip.rs b/bindings/rust/libgpiod/src/chip.rs index 9c3c2b414170..f4554a116946 100644 --- a/bindings/rust/libgpiod/src/chip.rs +++ b/bindings/rust/libgpiod/src/chip.rs @@ -206,9 +206,8 @@ impl Chip { // SAFETY: The `gpiod_line_request` returned by libgpiod is guaranteed to live as long // as the `struct Request`. - let request = unsafe { - gpiod::gpiod_chip_request_lines(self.ichip.chip, req_cfg, lconfig.config) - }; + let request = + unsafe { gpiod::gpiod_chip_request_lines(self.ichip.chip, req_cfg, lconfig.config) }; if request.is_null() { return Err(Error::OperationFailed( diff --git a/bindings/rust/libgpiod/src/lib.rs b/bindings/rust/libgpiod/src/lib.rs index a5d018cab73e..4abfcf2ba405 100644 --- a/bindings/rust/libgpiod/src/lib.rs +++ b/bindings/rust/libgpiod/src/lib.rs @@ -35,6 +35,9 @@ use gpiod::{ gpiod_line_bias_GPIOD_LINE_BIAS_PULL_DOWN as GPIOD_LINE_BIAS_PULL_DOWN, gpiod_line_bias_GPIOD_LINE_BIAS_PULL_UP as GPIOD_LINE_BIAS_PULL_UP, gpiod_line_bias_GPIOD_LINE_BIAS_UNKNOWN as GPIOD_LINE_BIAS_UNKNOWN, + gpiod_line_clock_GPIOD_LINE_CLOCK_HTE as GPIOD_LINE_CLOCK_HTE, + gpiod_line_clock_GPIOD_LINE_CLOCK_MONOTONIC as GPIOD_LINE_CLOCK_MONOTONIC, + gpiod_line_clock_GPIOD_LINE_CLOCK_REALTIME as GPIOD_LINE_CLOCK_REALTIME, gpiod_line_direction_GPIOD_LINE_DIRECTION_AS_IS as GPIOD_LINE_DIRECTION_AS_IS, gpiod_line_direction_GPIOD_LINE_DIRECTION_INPUT as GPIOD_LINE_DIRECTION_INPUT, gpiod_line_direction_GPIOD_LINE_DIRECTION_OUTPUT as GPIOD_LINE_DIRECTION_OUTPUT, @@ -45,12 +48,9 @@ use gpiod::{ gpiod_line_edge_GPIOD_LINE_EDGE_FALLING as GPIOD_LINE_EDGE_FALLING, gpiod_line_edge_GPIOD_LINE_EDGE_NONE as GPIOD_LINE_EDGE_NONE, gpiod_line_edge_GPIOD_LINE_EDGE_RISING as GPIOD_LINE_EDGE_RISING, - gpiod_line_clock_GPIOD_LINE_CLOCK_HTE as GPIOD_LINE_CLOCK_HTE, - gpiod_line_clock_GPIOD_LINE_CLOCK_MONOTONIC as GPIOD_LINE_CLOCK_MONOTONIC, - gpiod_line_clock_GPIOD_LINE_CLOCK_REALTIME as GPIOD_LINE_CLOCK_REALTIME, gpiod_line_value_GPIOD_LINE_VALUE_ACTIVE as GPIOD_LINE_VALUE_ACTIVE, - gpiod_line_value_GPIOD_LINE_VALUE_INACTIVE as GPIOD_LINE_VALUE_INACTIVE, gpiod_line_value_GPIOD_LINE_VALUE_ERROR as GPIOD_LINE_VALUE_ERROR, + gpiod_line_value_GPIOD_LINE_VALUE_INACTIVE as GPIOD_LINE_VALUE_INACTIVE, }; /// Operation types, used with OperationFailed() Error. -- 2.31.1.272.g89b43f80a514