Skip to content

Commit 98fe200

Browse files
committed
refactor: clippy suggestions
1 parent 090e491 commit 98fe200

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/event/format/known_schema.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,9 @@ impl SchemaDefinition {
9393
return Some(pattern.fields.clone());
9494
}
9595

96-
let Some(event) = extract_log
96+
let event = extract_log
9797
.and_then(|field| obj.get(field))
98-
.and_then(|s| s.as_str())
99-
else {
100-
return None;
101-
};
98+
.and_then(|s| s.as_str())?;
10299

103100
for format in self.patterns.iter() {
104101
let Some(pattern) = format.pattern.as_ref() else {
@@ -157,7 +154,7 @@ impl EventProcessor {
157154
let schema = processor
158155
.schema_definitions
159156
.entry(format.name.clone())
160-
.or_insert_with(SchemaDefinition::default);
157+
.or_default();
161158

162159
schema.patterns.push(regex);
163160
}

0 commit comments

Comments
 (0)