Skip to content

Commit

Permalink
AVRO-3844: [Rust] Fix clippy errors with Rust 1.72.0 (#2466)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
  • Loading branch information
martin-g authored Aug 24, 2023
1 parent 514d497 commit a09d3fd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lang/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ exclude = [
"fuzz"
]

resolver = "2"

[workspace.package]
version = "0.16.0"
authors = ["Apache Avro team <dev@avro.apache.org>"]
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ mod tests {
c: vec!["cat".into(), "dog".into()],
};
// The two-byte marker, to show that the message uses this single-record format
let to_read_1 = vec![0xC3, 0x01];
let to_read_1 = [0xC3, 0x01];
let mut to_read_2 = Vec::<u8>::new();
to_read_2.extend_from_slice(
&TestSingleObjectReader::get_schema()
Expand Down
4 changes: 2 additions & 2 deletions lang/rust/avro/src/schema_compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ impl SchemaCompatibility {
}

if w_type == SchemaKind::Int
&& vec![SchemaKind::Long, SchemaKind::Float, SchemaKind::Double]
&& [SchemaKind::Long, SchemaKind::Float, SchemaKind::Double]
.iter()
.any(|&t| t == r_type)
{
return true;
}

if w_type == SchemaKind::Long
&& vec![SchemaKind::Float, SchemaKind::Double]
&& [SchemaKind::Float, SchemaKind::Double]
.iter()
.any(|&t| t == r_type)
{
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ mod tests {
let mut expected = Vec::new();
zig_i64(27, &mut expected);
zig_i64(3, &mut expected);
expected.extend(vec![b'f', b'o', b'o'].into_iter());
expected.extend([b'f', b'o', b'o']);

assert_eq!(to_avro_datum(&schema, record)?, expected);

Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/tests/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn test_binary_long_encoding() -> TestResult {
fn test_schema_promotion() -> TestResult {
// Each schema is present in order of promotion (int -> long, long -> float, float -> double)
// Each value represents the expected decoded value when promoting a value previously encoded with a promotable schema
let promotable_schemas = vec![r#""int""#, r#""long""#, r#""float""#, r#""double""#];
let promotable_schemas = [r#""int""#, r#""long""#, r#""float""#, r#""double""#];
let promotable_values = vec![
Value::Int(219),
Value::Long(219),
Expand Down

0 comments on commit a09d3fd

Please sign in to comment.