Skip to content

Commit 1c41bdb

Browse files
committed
clippy: fix unwrap_or followed by new
``` src/main.rs:139:18: 139:73 warning: use of `unwrap_or` followed by a call to `new`, #[warn(or_fun_call)] on by default src/main.rs:139 configs: matches.values_of_lossy("config").unwrap_or(Vec::new()), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/main.rs:139:18: 139:73 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call src/main.rs:139:18: 139:73 help: try this src/main.rs: configs: matches.values_of_lossy("config").unwrap_or_default(), ``` Signed-off-by: Paul Osborne <[email protected]>
1 parent e74acce commit 1c41bdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn main() {
136136

137137
// process global options
138138
let gpio_options = GpioOptions {
139-
configs: matches.values_of_lossy("config").unwrap_or(Vec::new()),
139+
configs: matches.values_of_lossy("config").unwrap_or_default(),
140140
};
141141

142142
// parse the config

0 commit comments

Comments
 (0)