Skip to content

Commit

Permalink
Fix the formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Feb 21, 2025
1 parent 1ae15cc commit cb32e66
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions avro/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ impl Record<'_> {
///
/// Get the value for a given field name. Returns `None` if the field is not present in the schema
pub fn get(&self, field: &str) -> Option<&Value> {
self.schema_lookup.get(field)
self.schema_lookup
.get(field)
.map(|&position| &self.fields[position].1)
}
}
Expand Down Expand Up @@ -3257,7 +3258,10 @@ Field with name '"b"' is not a member of the map items"#,
record.put("foo", "hello");
record.put("bar", 123_i64);

assert_eq!(record.get("foo").unwrap().clone(), Value::String("hello".to_string()));
assert_eq!(
record.get("foo").unwrap().clone(),
Value::String("hello".to_string())
);
assert_eq!(record.get("bar").unwrap().clone(), Value::Long(123));

// also make sure it doesn't fail but return None for non-existing field
Expand Down

0 comments on commit cb32e66

Please sign in to comment.