From d7e97331e59819735b1c07dcff63c35b01e263b2 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Mon, 22 May 2023 15:00:48 +0900 Subject: [PATCH] Minor refactoring find field (#2055) * Minor refactoring Moving find_field_with_default to Schema. * Clippy comments --- src/schema/schema.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/schema.rs b/src/schema/schema.rs index 9b10376f2..b37a3af4a 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -426,7 +426,7 @@ impl Schema { ) -> Option<(Field, &'a str)> { let (field, json_path) = self .find_field(full_path) - .or(default_field_opt.and_then(|field| Some((field, full_path))))?; + .or(default_field_opt.map(|field| (field, full_path)))?; let field_entry = self.get_field_entry(field); let is_json = field_entry.field_type().value_type() == Type::Json; if is_json == json_path.is_empty() {