From 84314614fbd18cf4d924f373190d2a224ddc4972 Mon Sep 17 00:00:00 2001 From: Enrico Guiraud Date: Wed, 11 Jan 2023 16:35:10 -0600 Subject: [PATCH] docs: prefer ok_or to ok_or_else in README example As suggested by clippy when using the example code. --- clap_mangen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clap_mangen/README.md b/clap_mangen/README.md index 1d58a607e5b..15361a65c8d 100644 --- a/clap_mangen/README.md +++ b/clap_mangen/README.md @@ -34,7 +34,7 @@ clap_mangen = "0.1" In your `build.rs`: ```rust,no_run fn main() -> std::io::Result<()> { - let out_dir = std::path::PathBuf::from(std::env::var_os("OUT_DIR").ok_or_else(|| std::io::ErrorKind::NotFound)?); + let out_dir = std::path::PathBuf::from(std::env::var_os("OUT_DIR").ok_or(std::io::ErrorKind::NotFound)?); let cmd = clap::Command::new("mybin") .arg(clap::arg!(-n --name ))