We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 588150c commit c8c2de5Copy full SHA for c8c2de5
src/lib.rs
@@ -140,12 +140,7 @@ pub struct SpidevOptions {
140
impl SpidevOptions {
141
/// Create a new, empty set of options
142
pub fn new() -> SpidevOptions {
143
- SpidevOptions {
144
- bits_per_word: None,
145
- max_speed_hz: None,
146
- lsb_first: None,
147
- spi_mode: None,
148
- }
+ SpidevOptions::default()
149
}
150
151
/// The number of bits in each SPI transfer word
@@ -194,7 +189,7 @@ impl SpidevOptions {
194
189
195
190
/// Finalize and build the SpidevOptions
196
191
pub fn build(&self) -> Self {
197
- self.clone()
192
+ *self
198
193
199
200
0 commit comments