Skip to content

Commit dc9dd5e

Browse files
committed
cargo fmt
1 parent 8a895d5 commit dc9dd5e

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

datafusion/common/src/error.rs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ impl From<GenericError> for DataFusionError {
297297
if err.is::<DataFusionError>() {
298298
if let Ok(e) = err.downcast::<DataFusionError>() {
299299
*e
300-
} else { unreachable!() }
300+
} else {
301+
unreachable!()
302+
}
301303
} else {
302304
DataFusionError::External(err)
303305
}
@@ -820,30 +822,40 @@ mod test {
820822
#[test]
821823
fn external_error() {
822824
// assert not wrapping DataFusionError
823-
let generic_error: GenericError = Box::new(DataFusionError::Plan("test".to_string()));
825+
let generic_error: GenericError =
826+
Box::new(DataFusionError::Plan("test".to_string()));
824827
let datafusion_error: DataFusionError = generic_error.into();
825828
println!("{}", datafusion_error.strip_backtrace());
826-
assert_eq!(datafusion_error.strip_backtrace(), "Error during planning: test");
829+
assert_eq!(
830+
datafusion_error.strip_backtrace(),
831+
"Error during planning: test"
832+
);
827833

828834
// assert wrapping other Error
829-
let generic_error: GenericError = Box::new(std::io::Error::new(std::io::ErrorKind::Other, "io error"));
835+
let generic_error: GenericError =
836+
Box::new(std::io::Error::new(std::io::ErrorKind::Other, "io error"));
830837
let datafusion_error: DataFusionError = generic_error.into();
831838
println!("{}", datafusion_error.strip_backtrace());
832-
assert_eq!(datafusion_error.strip_backtrace(), "External error: io error");
839+
assert_eq!(
840+
datafusion_error.strip_backtrace(),
841+
"External error: io error"
842+
);
833843
}
834844

835845
#[test]
836846
fn external_error_no_recursive() {
837-
let generic_error_1: GenericError = Box::new(std::io::Error::new(std::io::ErrorKind::Other, "io error"));
838-
let external_error_1 : DataFusionError = generic_error_1.into();
839-
let generic_error_2 : GenericError = Box::new(external_error_1);
847+
let generic_error_1: GenericError =
848+
Box::new(std::io::Error::new(std::io::ErrorKind::Other, "io error"));
849+
let external_error_1: DataFusionError = generic_error_1.into();
850+
let generic_error_2: GenericError = Box::new(external_error_1);
840851
let external_error_2: DataFusionError = generic_error_2.into();
841852

842853
println!("{}", external_error_2);
843-
assert!(external_error_2.to_string().starts_with("External error: io error"));
854+
assert!(external_error_2
855+
.to_string()
856+
.starts_with("External error: io error"));
844857
}
845858

846-
847859
/// Model what happens when implementing SendableRecordBatchStream:
848860
/// DataFusion code needs to return an ArrowError
849861
fn return_arrow_error() -> arrow::error::Result<()> {

0 commit comments

Comments
 (0)