Skip to content

Commit

Permalink
NO-ISSUE: [Rust] Fix clippy errors for Rust 1.75.0
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 Jan 2, 2024
1 parent a0b277f commit df74c9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lang/rust/avro/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ impl RecordField {
});

if !resolved {
let schema: Option<&Schema> = schemas.get(0);
let schema: Option<&Schema> = schemas.first();
return match schema {
Some(first_schema) => Err(Error::GetDefaultUnion(
SchemaKind::from(first_schema),
Expand Down Expand Up @@ -2541,7 +2541,7 @@ mod tests {

match schema_a {
Schema::Record(RecordSchema { fields, .. }) => {
let f1 = fields.get(0);
let f1 = fields.first();

let ref_schema = Schema::Ref {
name: Name::new("B")?,
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,7 @@ Field with name '"b"' is not a member of the map items"#,

let schemas = Schema::parse_list(&[main_schema, referenced_schema])?;

let main_schema = schemas.get(0).unwrap();
let main_schema = schemas.first().unwrap();
let schemata: Vec<_> = schemas.iter().skip(1).collect();

let resolve_result = avro_value.clone().resolve_schemata(main_schema, schemata);
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro_derive/tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ mod test_derive {

let derived_schema = TestRawIdent::get_schema();
if let Schema::Record(RecordSchema { fields, .. }) = derived_schema {
let field = fields.get(0).expect("TestRawIdent must contain a field");
let field = fields.first().expect("TestRawIdent must contain a field");
assert_eq!(field.name, "type");
} else {
panic!("Unexpected schema type for {derived_schema:?}")
Expand Down

0 comments on commit df74c9f

Please sign in to comment.