Skip to content

Commit

Permalink
Fix clippy lints in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alpha-tango-kilo authored Jul 1, 2024
1 parent f0a8cd6 commit a458130
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/serde_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ fn new_serializer() -> Serializer<VecWriter> {
Serializer::new(VecWriter::new())
}

fn new_deserializer<'event>(
events: Vec<Event<'event>>,
) -> Deserializer<'event, Vec<Result<Event<'event>, Error>>> {
fn new_deserializer(events: Vec<Event>) -> Deserializer<Vec<Result<Event, Error>>> {
let result_events = events.into_iter().map(Ok).collect();
Deserializer::new(result_events)
}
Expand All @@ -105,7 +103,7 @@ where
Value::Boolean(false)
};

assert_eq!(&events[..], &expected_events[..]);
assert_eq!(&events[..], expected_events);

if roundtrip_value {
let expected_value = Value::from_events(expected_events.iter().cloned().map(Ok))
Expand Down
2 changes: 1 addition & 1 deletion src/stream/binary_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ mod tests {
let streaming_parser = BinaryReader::new(Cursor::new(buf_inner));

let events: Vec<Result<_, _>> = streaming_parser.collect();
let value_decoded_from_encode = Value::from_events(events.into_iter()).unwrap();
let value_decoded_from_encode = Value::from_events(events).unwrap();

assert_eq!(value_to_encode, value_decoded_from_encode);
}
Expand Down
4 changes: 2 additions & 2 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ mod tests {
);

let date: Date = SystemTime::now().into();
assert_eq!(Value::Date(date.clone()).as_date(), Some(date));
assert_eq!(Value::Date(date).as_date(), Some(date));

assert_eq!(Value::Real(0.0).as_real(), Some(0.0));
assert_eq!(Value::Integer(1.into()).as_signed_integer(), Some(1));
Expand Down Expand Up @@ -838,7 +838,7 @@ mod tests {
EndCollection,
];

let value = Builder::build(events.into_iter().map(|e| Ok(e)));
let value = Builder::build(events.into_iter().map(Ok));

// Expected output
let lines = vec![
Expand Down

0 comments on commit a458130

Please sign in to comment.