From 4b1f0d251a542ad1f02c7b17005ff18ea893d78f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 20 Jun 2021 18:52:46 +0200 Subject: Refactor iteration to be less nested Split closure into two distinct map calls, to reduce nesting here and improve readability. Signed-off-by: Matthias Beyer --- src/repository/repository.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/repository') diff --git a/src/repository/repository.rs b/src/repository/repository.rs index 8dee4cb..45c4604 100644 --- a/src/repository/repository.rs +++ b/src/repository/repository.rs @@ -144,7 +144,8 @@ impl Repository { // Map all `Value`s to String and then join them on the path that is relative to // the root directory of the repository. - .map(|patch| patch.into_str().map_err(Error::from)) + .map(config::Value::into_str) + .map_err(Error::from) .map_ok(|patch| path_relative_to_root.join(patch)) .inspect(|patch| trace!("Patch relative to root: {:?}", patch.as_ref().map(|p| p.display()))) -- cgit v1.2.3