From 67ffa4625098c2492fbdcd87f989bd63174362c3 Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Tue, 5 May 2020 19:43:58 +0200 Subject: [PATCH] Missed `matches!` in tests --- src/tests/recursive.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/recursive.rs b/src/tests/recursive.rs index b158f13..a62dead 100644 --- a/src/tests/recursive.rs +++ b/src/tests/recursive.rs @@ -884,9 +884,9 @@ fn try_filter_entry() { dir.mkdirp("foo/bar/baz/abc"); dir.mkdirp("quux"); - let wd = WalkDir::new(dir.path()).into_iter().try_filter_entry( - |res| matches!(res, Ok(ent) if ent.file_name() != "baz"), - ); + let wd = WalkDir::new(dir.path()).into_iter().try_filter_entry(|res| { + res.as_ref().map(|ent| ent.file_name() != "baz").unwrap_or(false) + }); let r = dir.run_recursive(wd); r.assert_no_errors();