mirror of https://github.com/smol-rs/blocking
Fix clippy::or_fun_call warning in example
``` warning: use of `unwrap_or` followed by a function call --> examples/ls.rs:15:35 | 15 | let path = env::args().nth(1).unwrap_or(".".into()); | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| ".".into())` | = note: `#[warn(clippy::or_fun_call)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call ```
This commit is contained in:
parent
b6e8f8e875
commit
c1b8fae3cc
|
@ -12,7 +12,7 @@ use blocking::Unblock;
|
|||
use futures_lite::{future, prelude::*};
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
let path = env::args().nth(1).unwrap_or(".".into());
|
||||
let path = env::args().nth(1).unwrap_or_else(|| ".".into());
|
||||
|
||||
future::block_on(async {
|
||||
let mut dir = Unblock::new(fs::read_dir(path)?);
|
||||
|
|
Loading…
Reference in New Issue