Skip to content

Commit e15b0d2

Browse files
author
Devdutt Shenoi
committed
style: deepsource suggestion
1 parent d096ce0 commit e15b0d2

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/event/format/json.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,17 @@ impl EventFormat for Event {
292292
.join("")
293293
);
294294

295-
match json_partitions.get_mut(&prefix) {
296-
Some(JsonPartition { batch, .. }) => batch.push(json),
297-
_ => {
298-
let date = parsed_timestamp.date();
299-
let batch = vec![json];
300-
json_partitions.insert(
301-
prefix,
302-
JsonPartition {
303-
batch,
304-
schema,
305-
date,
306-
},
307-
);
308-
}
295+
if let Some(JsonPartition { batch, .. }) = json_partitions.get_mut(&prefix) {
296+
batch.push(json)
297+
} else {
298+
json_partitions.insert(
299+
prefix,
300+
JsonPartition {
301+
batch: vec![json],
302+
schema,
303+
date: parsed_timestamp.date(),
304+
},
305+
);
309306
}
310307
}
311308

0 commit comments

Comments
 (0)