@@ -39,7 +39,7 @@ pub(super) fn compute_grid_layout_info(
3939 let constraints_result = grid_layout_cell_constraints ( layout, o, ctx, cross_axis_size_override) ;
4040 let orientation_literal = llr_Expression:: EnumerationValue ( EnumerationValue {
4141 value : o as _ ,
42- enumeration : crate :: typeregister:: BUILTIN . with ( |b| b . enums . Orientation . clone ( ) ) ,
42+ enumeration : crate :: typeregister:: BUILTIN . enums . Orientation . clone ( ) ,
4343 } ) ;
4444
4545 let sub_expression = llr_Expression:: ExtraBuiltinFunctionCall {
@@ -125,7 +125,7 @@ pub(super) fn organize_grid_layout(
125125 let input_data = grid_layout_input_data ( layout, ctx) ;
126126
127127 if let Some ( button_roles) = & layout. dialog_button_roles {
128- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . DialogButtonRole . clone ( ) ) ;
128+ let e = crate :: typeregister:: BUILTIN . enums . DialogButtonRole . clone ( ) ;
129129 let roles = button_roles
130130 . iter ( )
131131 . map ( |r| {
@@ -194,7 +194,7 @@ pub(super) fn solve_grid_layout(
194194 let size = layout_geometry_size ( & layout. geometry . rect , o, ctx) ;
195195 let orientation_expr = llr_Expression:: EnumerationValue ( EnumerationValue {
196196 value : o as _ ,
197- enumeration : crate :: typeregister:: BUILTIN . with ( |b| b . enums . Orientation . clone ( ) ) ,
197+ enumeration : crate :: typeregister:: BUILTIN . enums . Orientation . clone ( ) ,
198198 } ) ;
199199 let data = make_struct (
200200 BuiltinStruct :: GridLayoutData ,
@@ -278,21 +278,20 @@ pub(super) fn solve_box_layout(
278278 ( "padding" , padding. ty ( ctx) , padding) ,
279279 (
280280 "alignment" ,
281- crate :: typeregister:: BUILTIN
282- . with ( |e| Type :: Enumeration ( e. enums . LayoutAlignment . clone ( ) ) ) ,
281+ Type :: Enumeration ( crate :: typeregister:: BUILTIN . enums . LayoutAlignment . clone ( ) ) ,
283282 bld. alignment ,
284283 ) ,
285284 ( "cells" , bld. cells . ty ( ctx) , bld. cells ) ,
286285 ] ,
287286 ) ;
288287 ( data, "solve_box_layout" )
289288 } else {
290- let cross_axis_alignment_ty = crate :: typeregister :: BUILTIN
291- . with ( |e| Type :: Enumeration ( e . enums . CrossAxisAlignment . clone ( ) ) ) ;
289+ let cross_axis_alignment_ty =
290+ Type :: Enumeration ( crate :: typeregister :: BUILTIN . enums . CrossAxisAlignment . clone ( ) ) ;
292291 let cross_axis_alignment = if let Some ( nr) = & layout. cross_alignment {
293292 llr_Expression:: PropertyReference ( ctx. map_property_reference ( nr) )
294293 } else {
295- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . CrossAxisAlignment . clone ( ) ) ;
294+ let e = crate :: typeregister:: BUILTIN . enums . CrossAxisAlignment . clone ( ) ;
296295 llr_Expression:: EnumerationValue ( EnumerationValue {
297296 value : e. default_value ,
298297 enumeration : e,
@@ -376,32 +375,31 @@ pub(super) fn solve_flexbox_layout(
376375 ( "padding_v" , padding_v. ty ( ctx) , padding_v) ,
377376 (
378377 "alignment" ,
379- crate :: typeregister:: BUILTIN
380- . with ( |e| Type :: Enumeration ( e. enums . LayoutAlignment . clone ( ) ) ) ,
378+ Type :: Enumeration ( crate :: typeregister:: BUILTIN . enums . LayoutAlignment . clone ( ) ) ,
381379 fld. alignment ,
382380 ) ,
383381 (
384382 "direction" ,
385- crate :: typeregister:: BUILTIN
386- . with ( |e| Type :: Enumeration ( e. enums . FlexboxLayoutDirection . clone ( ) ) ) ,
383+ Type :: Enumeration (
384+ crate :: typeregister:: BUILTIN . enums . FlexboxLayoutDirection . clone ( ) ,
385+ ) ,
387386 fld. direction ,
388387 ) ,
389388 (
390389 "align_content" ,
391- crate :: typeregister:: BUILTIN
392- . with ( |e| Type :: Enumeration ( e. enums . FlexboxLayoutAlignContent . clone ( ) ) ) ,
390+ Type :: Enumeration (
391+ crate :: typeregister:: BUILTIN . enums . FlexboxLayoutAlignContent . clone ( ) ,
392+ ) ,
393393 fld. align_content ,
394394 ) ,
395395 (
396396 "cross_axis_alignment" ,
397- crate :: typeregister:: BUILTIN
398- . with ( |e| Type :: Enumeration ( e. enums . CrossAxisAlignment . clone ( ) ) ) ,
397+ Type :: Enumeration ( crate :: typeregister:: BUILTIN . enums . CrossAxisAlignment . clone ( ) ) ,
399398 fld. cross_axis_alignment ,
400399 ) ,
401400 (
402401 "flex_wrap" ,
403- crate :: typeregister:: BUILTIN
404- . with ( |e| Type :: Enumeration ( e. enums . FlexboxLayoutWrap . clone ( ) ) ) ,
402+ Type :: Enumeration ( crate :: typeregister:: BUILTIN . enums . FlexboxLayoutWrap . clone ( ) ) ,
405403 fld. flex_wrap ,
406404 ) ,
407405 ( "cells_h" , fld. cells_h . ty ( ctx) , fld. cells_h ) ,
@@ -625,8 +623,7 @@ pub(super) fn compute_flexbox_layout_info(
625623 ) ;
626624
627625 // Condition: direction == Row || direction == RowReverse
628- let direction_enum =
629- crate :: typeregister:: BUILTIN . with ( |e| e. enums . FlexboxLayoutDirection . clone ( ) ) ;
626+ let direction_enum = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutDirection . clone ( ) ;
630627 let direction_ref = llr_Expression:: PropertyReference (
631628 ctx. map_property_reference ( layout. direction . as_ref ( ) . unwrap ( ) ) ,
632629 ) ;
@@ -798,7 +795,7 @@ fn flexbox_layout_data(
798795 let alignment = if let Some ( expr) = & layout. geometry . alignment {
799796 llr_Expression:: PropertyReference ( ctx. map_property_reference ( expr) )
800797 } else {
801- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . LayoutAlignment . clone ( ) ) ;
798+ let e = crate :: typeregister:: BUILTIN . enums . LayoutAlignment . clone ( ) ;
802799 llr_Expression:: EnumerationValue ( EnumerationValue {
803800 value : e. default_value ,
804801 enumeration : e,
@@ -808,7 +805,7 @@ fn flexbox_layout_data(
808805 let direction = if let Some ( expr) = & layout. direction {
809806 llr_Expression:: PropertyReference ( ctx. map_property_reference ( expr) )
810807 } else {
811- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . FlexboxLayoutDirection . clone ( ) ) ;
808+ let e = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutDirection . clone ( ) ;
812809 llr_Expression:: EnumerationValue ( EnumerationValue {
813810 value : e. default_value ,
814811 enumeration : e,
@@ -818,7 +815,7 @@ fn flexbox_layout_data(
818815 let align_content = if let Some ( expr) = & layout. align_content {
819816 llr_Expression:: PropertyReference ( ctx. map_property_reference ( expr) )
820817 } else {
821- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . FlexboxLayoutAlignContent . clone ( ) ) ;
818+ let e = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutAlignContent . clone ( ) ;
822819 llr_Expression:: EnumerationValue ( EnumerationValue {
823820 value : e. default_value ,
824821 enumeration : e,
@@ -828,7 +825,7 @@ fn flexbox_layout_data(
828825 let cross_axis_alignment = if let Some ( expr) = & layout. cross_axis_alignment {
829826 llr_Expression:: PropertyReference ( ctx. map_property_reference ( expr) )
830827 } else {
831- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . CrossAxisAlignment . clone ( ) ) ;
828+ let e = crate :: typeregister:: BUILTIN . enums . CrossAxisAlignment . clone ( ) ;
832829 llr_Expression:: EnumerationValue ( EnumerationValue {
833830 value : e. default_value ,
834831 enumeration : e,
@@ -838,7 +835,7 @@ fn flexbox_layout_data(
838835 let flex_wrap = if let Some ( expr) = & layout. flex_wrap {
839836 llr_Expression:: PropertyReference ( ctx. map_property_reference ( expr) )
840837 } else {
841- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . FlexboxLayoutWrap . clone ( ) ) ;
838+ let e = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutWrap . clone ( ) ;
842839 llr_Expression:: EnumerationValue ( EnumerationValue {
843840 value : e. default_value ,
844841 enumeration : e,
@@ -1052,7 +1049,7 @@ struct BoxLayoutDataResult {
10521049}
10531050
10541051fn default_align_self ( ) -> ( Type , llr_Expression ) {
1055- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . FlexboxLayoutAlignSelf . clone ( ) ) ;
1052+ let e = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutAlignSelf . clone ( ) ;
10561053 (
10571054 Type :: Enumeration ( e. clone ( ) ) ,
10581055 llr_Expression:: EnumerationValue ( EnumerationValue {
@@ -1103,7 +1100,7 @@ fn box_layout_data(
11031100 let alignment = if let Some ( expr) = & layout. geometry . alignment {
11041101 llr_Expression:: PropertyReference ( ctx. map_property_reference ( expr) )
11051102 } else {
1106- let e = crate :: typeregister:: BUILTIN . with ( |e| e . enums . LayoutAlignment . clone ( ) ) ;
1103+ let e = crate :: typeregister:: BUILTIN . enums . LayoutAlignment . clone ( ) ;
11071104 llr_Expression:: EnumerationValue ( EnumerationValue {
11081105 value : e. default_value ,
11091106 enumeration : e,
@@ -1317,8 +1314,7 @@ fn clamp_wrapping_flex_cross_preferred(
13171314 // wrapping flex is clamped. Decide at runtime when flex-wrap is dynamic.
13181315 let new_preferred = match & flex. flex_wrap {
13191316 Some ( nr) => {
1320- let wrap_enum =
1321- crate :: typeregister:: BUILTIN . with ( |e| e. enums . FlexboxLayoutWrap . clone ( ) ) ;
1317+ let wrap_enum = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutWrap . clone ( ) ;
13221318 let is_no_wrap = llr_Expression:: BinaryExpression {
13231319 lhs : Box :: new ( llr_Expression:: PropertyReference ( ctx. map_property_reference ( nr) ) ) ,
13241320 rhs : Box :: new ( llr_Expression:: EnumerationValue ( EnumerationValue {
@@ -1350,8 +1346,7 @@ fn clamp_wrapping_flex_cross_preferred(
13501346 FlexboxAxisRelation :: MainAxis => clamped_struct,
13511347 FlexboxAxisRelation :: CrossAxis => unreachable ! ( "returned early above" ) ,
13521348 FlexboxAxisRelation :: Unknown => {
1353- let direction_enum =
1354- crate :: typeregister:: BUILTIN . with ( |e| e. enums . FlexboxLayoutDirection . clone ( ) ) ;
1349+ let direction_enum = crate :: typeregister:: BUILTIN . enums . FlexboxLayoutDirection . clone ( ) ;
13551350 let direction_ref = llr_Expression:: PropertyReference (
13561351 ctx. map_property_reference ( flex. direction . as_ref ( ) . unwrap ( ) ) ,
13571352 ) ;
0 commit comments