Skip to content

Commit 23830f1

Browse files
committed
clippy
1 parent 74d3603 commit 23830f1

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

datafusion/common/src/column.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ mod tests {
428428
)
429429
.expect_err("should've failed to find field");
430430
let expected = r#"Schema error: No field named z. Valid fields are t1.a, t1.b, t2.c, t2.d, t3.a, t3.b, t3.c, t3.d, t3.e."#;
431-
assert!(err.to_string().start_with(expected));
431+
assert!(err.to_string().starts_with(expected));
432432

433433
// ambiguous column reference
434434
let col = Column::from_name("a");
@@ -439,7 +439,7 @@ mod tests {
439439
)
440440
.expect_err("should've found ambiguous field");
441441
let expected = "Schema error: Ambiguous reference to unqualified field a";
442-
assert!(err.to_string().start_with(expected));
442+
assert!(err.to_string().starts_with(expected));
443443

444444
Ok(())
445445
}

datafusion/common/src/dfschema.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,9 @@ mod tests {
914914
let left = DFSchema::try_from(test_schema_1())?;
915915
let right = DFSchema::try_from(test_schema_1())?;
916916
let join = left.join(&right);
917-
assert!(
918-
join.unwrap_err().to_string().starts_with(,
919-
"Schema error: Schema contains duplicate unqualified field name c0")
920-
);
917+
assert!(join.unwrap_err().to_string().starts_with(
918+
"Schema error: Schema contains duplicate unqualified field name c0"
919+
));
921920
Ok(())
922921
}
923922

datafusion/common/src/error.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,17 +507,15 @@ mod test {
507507
#[test]
508508
fn arrow_error_to_datafusion() {
509509
let res = return_arrow_error().unwrap_err();
510-
assert!(
511-
res.to_string().starts_with(,
512-
"External error: Error during planning: foo")
513-
);
510+
assert!(res
511+
.to_string()
512+
.starts_with("External error: Error during planning: foo"));
514513
}
515514

516515
#[test]
517516
fn datafusion_error_to_arrow() {
518517
let res = return_datafusion_error().unwrap_err();
519-
assert_eq!(res
520-
.to_string()
518+
assert!(res
521519
.to_string()
522520
.starts_with("Arrow error: Schema error: bar"));
523521
}
@@ -631,7 +629,7 @@ mod test {
631629
let e = e.find_root();
632630

633631
// DataFusionError does not implement Eq, so we use a string comparison + some cheap "same variant" test instead
634-
assert!(e.to_string().starts_with(exp.to_string()));
632+
assert!(e.to_string().starts_with(&exp.to_string()));
635633
assert_eq!(std::mem::discriminant(e), std::mem::discriminant(&exp),)
636634
}
637635
}

datafusion/common/src/scalar.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,10 +3239,9 @@ mod tests {
32393239
let int_value = ScalarValue::Int32(Some(i32::MAX));
32403240
let int_value_2 = ScalarValue::Int32(Some(i32::MIN));
32413241
let err = int_value.sub_checked(&int_value_2).unwrap_err().to_string();
3242-
assert!(
3243-
err.starts_with(,
3244-
"Arrow error: Compute error: Overflow happened on: 2147483647 - -2147483648")
3245-
)
3242+
assert!(err.starts_with(
3243+
"Arrow error: Compute error: Overflow happened on: 2147483647 - -2147483648"
3244+
))
32463245
}
32473246

32483247
#[test]

0 commit comments

Comments
 (0)