Skip to content

Commit 553d500

Browse files
committed
fmt
1 parent f95b4dc commit 553d500

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use super::graph::{
99
ArmExpr, BooleanIf, EvaluateExpr, FlowControlGraph, FlowControlGraphBuilder, FlowControlNode,
1010
NodeId,
1111
};
12-
use crate::{diagnostic::MatchKind, lower::context::LoweringContext};
12+
use crate::diagnostic::MatchKind;
13+
use crate::lower::context::LoweringContext;
1314

1415
mod cache;
1516
mod filtered_patterns;

crates/cairo-lang-lowering/src/lower/flow_control/graph_test.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ fn test_create_graph(
7575
};
7676

7777
// Lower the graph.
78-
let (lowered_str, lowering_diagnostics) = if args.get("skip_lowering").unwrap_or(&"false".into()) == "true" {
79-
("".into(), ctx.diagnostics.build().format(db))
80-
} else {
81-
let lowered = lower_graph_as_function(ctx, expr_id, &graph);
82-
(formatted_lowered(db, Some(&lowered)), lowered.diagnostics.format(db))
83-
};
78+
let (lowered_str, lowering_diagnostics) =
79+
if args.get("skip_lowering").unwrap_or(&"false".into()) == "true" {
80+
("".into(), ctx.diagnostics.build().format(db))
81+
} else {
82+
let lowered = lower_graph_as_function(ctx, expr_id, &graph);
83+
(formatted_lowered(db, Some(&lowered)), lowered.diagnostics.format(db))
84+
};
8485

8586
let error = verify_diagnostics_expectation(
8687
args,

crates/cairo-lang-lowering/src/lower/flow_control/lower_graph/lower_node.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use cairo_lang_syntax::node::TypedStablePtr;
66
use itertools::zip_eq;
77

88
use super::LowerGraphContext;
9-
use crate::diagnostic::{LoweringDiagnosticKind, LoweringDiagnosticsBuilder, MatchDiagnostic, MatchError};
9+
use crate::diagnostic::{
10+
LoweringDiagnosticKind, LoweringDiagnosticsBuilder, MatchDiagnostic, MatchError,
11+
};
1012
use crate::ids::SemanticFunctionIdEx;
1113
use crate::lower::block_builder::BlockBuilder;
1214
use crate::lower::context::{LoweredExpr, VarRequest};
@@ -15,7 +17,7 @@ use crate::lower::flow_control::graph::{
1517
FlowControlNode, NodeId,
1618
};
1719
use crate::lower::{
18-
generators, lower_expr, lower_expr_literal_to_var_usage, lower_expr_to_var_usage
20+
generators, lower_expr, lower_expr_literal_to_var_usage, lower_expr_to_var_usage,
1921
};
2022
use crate::{MatchArm, MatchEnumInfo, MatchExternInfo, MatchInfo, VarUsage};
2123

@@ -27,10 +29,10 @@ pub fn lower_node(ctx: &mut LowerGraphContext<'_, '_, '_>, id: NodeId) -> Maybe<
2729
if let FlowControlNode::ArmExpr(node) = ctx.graph.node(id) {
2830
let stable_ptr = ctx.ctx.function_body.arenas.exprs[node.expr].stable_ptr();
2931

30-
let match_error = LoweringDiagnosticKind::MatchError(MatchError{
31-
kind: ctx.graph.kind(),
32-
error: MatchDiagnostic::UnreachableMatchArm,
33-
});
32+
let match_error = LoweringDiagnosticKind::MatchError(MatchError {
33+
kind: ctx.graph.kind(),
34+
error: MatchDiagnostic::UnreachableMatchArm,
35+
});
3436
ctx.ctx.diagnostics.report(stable_ptr, match_error);
3537
}
3638

0 commit comments

Comments
 (0)