Skip to content

Commit

Permalink
Use Result.unwrap_or_else where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Aug 26, 2024
1 parent 02eab80 commit e671835
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datafusion/proto/tests/cases/roundtrip_logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ fn roundtrip_json_test(_proto: &protobuf::LogicalExprNode) {}
fn roundtrip_expr_test(initial_struct: Expr, ctx: SessionContext) {
let extension_codec = DefaultLogicalExtensionCodec {};
let proto: protobuf::LogicalExprNode =
match serialize_expr(&initial_struct, &extension_codec) {
Ok(p) => p,
Err(e) => panic!("Error serializing expression: {:?}", e),
};
serialize_expr(&initial_struct, &extension_codec)
.unwrap_or_else(|e| panic!("Error serializing expression: {:?}", e));
let round_trip: Expr =
from_proto::parse_expr(&proto, &ctx, &extension_codec).unwrap();

Expand Down

0 comments on commit e671835

Please sign in to comment.