Skip to content

Instantly share code, notes, and snippets.

@saethlin
Created May 24, 2017 04:38
Show Gist options
  • Save saethlin/103dad47b8260572bc99c4f5cbc11646 to your computer and use it in GitHub Desktop.
Save saethlin/103dad47b8260572bc99c4f5cbc11646 to your computer and use it in GitHub Desktop.
Clippy? Are you okay?
warning: use of `unwrap_or` followed by a function call
--> src/commands/ls.rs:30:33
|
30 | let dir = Path::new(options.value_of_os("directory").unwrap_or(state.directory.as_os_str()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this `options.value_of_os("directory").unwrap_or_else(|| state.directory.as_os_str())`
|
= note: #[warn(or_fun_call)] on by default
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment