Skip to content

Commit

Permalink
Use Result.unwrap_or_else where applicable (#12166)
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi authored Aug 26, 2024
1 parent 945902d commit 0c75ddd
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 0c75ddd

Please sign in to comment.