From 058e2602a266c970bee60984713e1f9650f4e76f Mon Sep 17 00:00:00 2001 From: Nathan West Date: Mon, 22 Oct 2018 16:02:37 -0700 Subject: [PATCH] Convert `unwrap_or` to `unwrap_or_else` --- lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.rs b/lib.rs index 9c623f9..de957e8 100644 --- a/lib.rs +++ b/lib.rs @@ -29,7 +29,7 @@ impl MyLib { /// See http://xion.io/post/code/rust-optional-args.html pub fn init>>(logger : L) -> Self { MyLib { - logger: logger.into().unwrap_or(slog::Logger::root(slog_stdlog::StdLog.fuse(), o!())), + logger: logger.into().unwrap_or_else(|| slog::Logger::root(slog_stdlog::StdLog.fuse(), o!())), } }