From f3896507e32ff1a1b0f6e9548529bc467fa66619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Fro=C5=82ow?= Date: Sat, 29 Aug 2020 13:46:40 +0200 Subject: [PATCH] No need to unwrap with and_then. And it was wrongly wrapped with Some instead of Ok. --- dotenv/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs index f2b1b0a..4017e81 100644 --- a/dotenv/src/lib.rs +++ b/dotenv/src/lib.rs @@ -75,7 +75,7 @@ pub fn vars() -> Vars { /// use std::env; /// use std::path::{Path}; /// -/// let my_path = env::home_dir().and_then(|a| Some(a.join("/.env"))).unwrap(); +/// let my_path = env::home_dir().map(|a| a.join("/.env")).unwrap(); /// dotenv::from_path(my_path.as_path()); /// ``` pub fn from_path>(path: P) -> Result<()> {