On 13-01-23, 22:52, Bartosz Golaszewski wrote: > diff --git a/bindings/rust/libgpiod/src/line_config.rs b/bindings/rust/libgpiod/src/line_config.rs > > + /// Set output values for a number of lines. > + pub fn set_output_values(&mut self, values: &[Value]) -> Result<&mut Self> { > + let mut mapped_values = Vec::new(); > + for value in values { > + mapped_values.push(value.value()); > + } Can be rewritten as this too: let values: Vec<gpiod::gpiod_line_value> = values.iter().map(|val| val.value()).collect(); > + > + let ret = unsafe { > + gpiod::gpiod_line_config_set_output_values(self.config, mapped_values.as_ptr(), > + values.len() as u64) > + }; > + > + if ret == -1 { > + Err(Error::OperationFailed( > + OperationType::LineConfigSetOutputValues, > + errno::errno(), > + )) > + } else { > + Ok(self) > + } > + } -- viresh