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:
Taiki Endo 2022-07-17 21:37:47 +09:00
parent b6e8f8e875
commit c1b8fae3cc
1 changed files with 1 additions and 1 deletions

View File

@ -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)?);