@@ -320,7 +320,7 @@ pub fn bool_widget(document_node: &DocumentNode, node_id: NodeId, index: usize,
320320 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
321321 return vec ! [ ] ;
322322 } ;
323- if let & Some ( & TaggedValue :: Bool ( x) ) = & input. as_non_exposed_value ( ) {
323+ if let Some ( & TaggedValue :: Bool ( x) ) = input. as_non_exposed_value ( ) {
324324 widgets. extend_from_slice ( & [
325325 Separator :: new ( SeparatorType :: Unrelated ) . widget_holder ( ) ,
326326 checkbox_input
@@ -349,7 +349,7 @@ pub fn footprint_widget(document_node: &DocumentNode, node_id: NodeId, index: us
349349 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
350350 return vec ! [ ] ;
351351 } ;
352- if let & Some ( & TaggedValue :: Footprint ( footprint) ) = & input. as_non_exposed_value ( ) {
352+ if let Some ( & TaggedValue :: Footprint ( footprint) ) = input. as_non_exposed_value ( ) {
353353 let top_left = footprint. transform . transform_point2 ( DVec2 :: ZERO ) ;
354354 let bounds = footprint. scale ( ) ;
355355 let oversample = footprint. resolution . as_dvec2 ( ) / bounds;
@@ -759,7 +759,7 @@ pub fn color_channel(document_node: &DocumentNode, node_id: NodeId, index: usize
759759 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
760760 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
761761 } ;
762- if let & Some ( & TaggedValue :: RedGreenBlue ( mode) ) = & input. as_non_exposed_value ( ) {
762+ if let Some ( & TaggedValue :: RedGreenBlue ( mode) ) = input. as_non_exposed_value ( ) {
763763 let calculation_modes = [ RedGreenBlue :: Red , RedGreenBlue :: Green , RedGreenBlue :: Blue ] ;
764764 let mut entries = Vec :: with_capacity ( calculation_modes. len ( ) ) ;
765765 for method in calculation_modes {
@@ -786,7 +786,7 @@ pub fn rgba_channel(document_node: &DocumentNode, node_id: NodeId, index: usize,
786786 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
787787 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
788788 } ;
789- if let & Some ( & TaggedValue :: RedGreenBlueAlpha ( mode) ) = & input. as_non_exposed_value ( ) {
789+ if let Some ( & TaggedValue :: RedGreenBlueAlpha ( mode) ) = input. as_non_exposed_value ( ) {
790790 let calculation_modes = [ RedGreenBlueAlpha :: Red , RedGreenBlueAlpha :: Green , RedGreenBlueAlpha :: Blue , RedGreenBlueAlpha :: Alpha ] ;
791791 let mut entries = Vec :: with_capacity ( calculation_modes. len ( ) ) ;
792792 for method in calculation_modes {
@@ -814,7 +814,7 @@ pub fn noise_type(document_node: &DocumentNode, node_id: NodeId, index: usize, n
814814 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
815815 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
816816 } ;
817- if let & Some ( & TaggedValue :: NoiseType ( noise_type) ) = & input. as_non_exposed_value ( ) {
817+ if let Some ( & TaggedValue :: NoiseType ( noise_type) ) = input. as_non_exposed_value ( ) {
818818 let entries = NoiseType :: list ( )
819819 . iter ( )
820820 . map ( |noise_type| {
@@ -840,7 +840,7 @@ pub fn fractal_type(document_node: &DocumentNode, node_id: NodeId, index: usize,
840840 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
841841 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
842842 } ;
843- if let & Some ( & TaggedValue :: FractalType ( fractal_type) ) = & input. as_non_exposed_value ( ) {
843+ if let Some ( & TaggedValue :: FractalType ( fractal_type) ) = input. as_non_exposed_value ( ) {
844844 let entries = FractalType :: list ( )
845845 . iter ( )
846846 . map ( |fractal_type| {
@@ -866,7 +866,7 @@ pub fn cellular_distance_function(document_node: &DocumentNode, node_id: NodeId,
866866 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
867867 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
868868 } ;
869- if let & Some ( & TaggedValue :: CellularDistanceFunction ( cellular_distance_function) ) = & input. as_non_exposed_value ( ) {
869+ if let Some ( & TaggedValue :: CellularDistanceFunction ( cellular_distance_function) ) = input. as_non_exposed_value ( ) {
870870 let entries = CellularDistanceFunction :: list ( )
871871 . iter ( )
872872 . map ( |cellular_distance_function| {
@@ -895,7 +895,7 @@ pub fn cellular_return_type(document_node: &DocumentNode, node_id: NodeId, index
895895 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
896896 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
897897 } ;
898- if let & Some ( & TaggedValue :: CellularReturnType ( cellular_return_type) ) = & input. as_non_exposed_value ( ) {
898+ if let Some ( & TaggedValue :: CellularReturnType ( cellular_return_type) ) = input. as_non_exposed_value ( ) {
899899 let entries = CellularReturnType :: list ( )
900900 . iter ( )
901901 . map ( |cellular_return_type| {
@@ -921,7 +921,7 @@ pub fn domain_warp_type(document_node: &DocumentNode, node_id: NodeId, index: us
921921 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
922922 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
923923 } ;
924- if let & Some ( & TaggedValue :: DomainWarpType ( domain_warp_type) ) = & input. as_non_exposed_value ( ) {
924+ if let Some ( & TaggedValue :: DomainWarpType ( domain_warp_type) ) = input. as_non_exposed_value ( ) {
925925 let entries = DomainWarpType :: list ( )
926926 . iter ( )
927927 . map ( |domain_warp_type| {
@@ -947,7 +947,7 @@ pub fn blend_mode(document_node: &DocumentNode, node_id: NodeId, index: usize, n
947947 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
948948 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
949949 } ;
950- if let & Some ( & TaggedValue :: BlendMode ( blend_mode) ) = & input. as_non_exposed_value ( ) {
950+ if let Some ( & TaggedValue :: BlendMode ( blend_mode) ) = input. as_non_exposed_value ( ) {
951951 let entries = BlendMode :: list_svg_subset ( )
952952 . iter ( )
953953 . map ( |category| {
@@ -980,7 +980,7 @@ pub fn luminance_calculation(document_node: &DocumentNode, node_id: NodeId, inde
980980 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
981981 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
982982 } ;
983- if let & Some ( & TaggedValue :: LuminanceCalculation ( calculation) ) = & input. as_non_exposed_value ( ) {
983+ if let Some ( & TaggedValue :: LuminanceCalculation ( calculation) ) = input. as_non_exposed_value ( ) {
984984 let calculation_modes = LuminanceCalculation :: list ( ) ;
985985 let mut entries = Vec :: with_capacity ( calculation_modes. len ( ) ) ;
986986 for method in calculation_modes {
@@ -1008,7 +1008,7 @@ pub fn boolean_operation_radio_buttons(document_node: &DocumentNode, node_id: No
10081008 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
10091009 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
10101010 } ;
1011- if let & Some ( & TaggedValue :: BooleanOperation ( calculation) ) = & input. as_non_exposed_value ( ) {
1011+ if let Some ( & TaggedValue :: BooleanOperation ( calculation) ) = input. as_non_exposed_value ( ) {
10121012 let operations = BooleanOperation :: list ( ) ;
10131013 let icons = BooleanOperation :: icons ( ) ;
10141014 let mut entries = Vec :: with_capacity ( operations. len ( ) ) ;
@@ -1037,7 +1037,7 @@ pub fn line_cap_widget(document_node: &DocumentNode, node_id: NodeId, index: usi
10371037 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
10381038 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
10391039 } ;
1040- if let & Some ( & TaggedValue :: LineCap ( line_cap) ) = & input. as_non_exposed_value ( ) {
1040+ if let Some ( & TaggedValue :: LineCap ( line_cap) ) = input. as_non_exposed_value ( ) {
10411041 let entries = [ ( "Butt" , LineCap :: Butt ) , ( "Round" , LineCap :: Round ) , ( "Square" , LineCap :: Square ) ]
10421042 . into_iter ( )
10431043 . map ( |( name, val) | {
@@ -1062,7 +1062,7 @@ pub fn line_join_widget(document_node: &DocumentNode, node_id: NodeId, index: us
10621062 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
10631063 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
10641064 } ;
1065- if let & Some ( & TaggedValue :: LineJoin ( line_join) ) = & input. as_non_exposed_value ( ) {
1065+ if let Some ( & TaggedValue :: LineJoin ( line_join) ) = input. as_non_exposed_value ( ) {
10661066 let entries = [ ( "Miter" , LineJoin :: Miter ) , ( "Bevel" , LineJoin :: Bevel ) , ( "Round" , LineJoin :: Round ) ]
10671067 . into_iter ( )
10681068 . map ( |( name, val) | {
@@ -1150,7 +1150,7 @@ pub fn centroid_widget(document_node: &DocumentNode, node_id: NodeId, index: usi
11501150 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
11511151 return LayoutGroup :: Row { widgets : vec ! [ ] } ;
11521152 } ;
1153- if let & Some ( & TaggedValue :: CentroidType ( centroid_type) ) = & input. as_non_exposed_value ( ) {
1153+ if let Some ( & TaggedValue :: CentroidType ( centroid_type) ) = input. as_non_exposed_value ( ) {
11541154 let entries = vec ! [
11551155 RadioEntryData :: new( "area" )
11561156 . label( "Area" )
@@ -1230,8 +1230,8 @@ pub fn query_assign_colors_randomize(node_id: NodeId, context: &NodePropertiesCo
12301230 let document_node = get_document_node ( node_id, context) ?;
12311231 // This is safe since the node is a proto node and the implementation cannot be changed.
12321232 let randomize_index = 5 ;
1233- Ok ( match & document_node. inputs . get ( randomize_index) . and_then ( |input| input. as_value ( ) ) {
1234- & Some ( & TaggedValue :: Bool ( randomize_enabled) ) => randomize_enabled,
1233+ Ok ( match document_node. inputs . get ( randomize_index) . and_then ( |input| input. as_value ( ) ) {
1234+ Some ( TaggedValue :: Bool ( randomize_enabled) ) => * randomize_enabled,
12351235 _ => false ,
12361236 } )
12371237}
@@ -1248,8 +1248,8 @@ pub(crate) fn channel_mixer_properties(node_id: NodeId, context: &mut NodeProper
12481248 // Monochrome
12491249 let monochrome_index = 1 ;
12501250 let monochrome = bool_widget ( document_node, node_id, monochrome_index, "Monochrome" , CheckboxInput :: default ( ) , true ) ;
1251- let is_monochrome = match & document_node. inputs [ monochrome_index] . as_value ( ) {
1252- & Some ( & TaggedValue :: Bool ( monochrome_choice) ) => monochrome_choice,
1251+ let is_monochrome = match document_node. inputs [ monochrome_index] . as_value ( ) {
1252+ Some ( TaggedValue :: Bool ( monochrome_choice) ) => * monochrome_choice,
12531253 _ => false ,
12541254 } ;
12551255
@@ -1281,7 +1281,7 @@ pub(crate) fn channel_mixer_properties(node_id: NodeId, context: &mut NodeProper
12811281 } ;
12821282
12831283 let is_output_channel = match & document_node. inputs [ output_channel_index] . as_value ( ) {
1284- & Some ( & TaggedValue :: RedGreenBlue ( choice) ) => choice,
1284+ Some ( TaggedValue :: RedGreenBlue ( choice) ) => choice,
12851285 _ => {
12861286 warn ! ( "Channel Mixer node properties panel could not be displayed." ) ;
12871287 return vec ! [ ] ;
@@ -1381,7 +1381,7 @@ pub(crate) fn selective_color_properties(node_id: NodeId, context: &mut NodeProp
13811381 }
13821382
13831383 let colors_choice_index = match & document_node. inputs [ colors_index] . as_value ( ) {
1384- & Some ( & TaggedValue :: SelectiveColorChoice ( choice) ) => choice,
1384+ Some ( TaggedValue :: SelectiveColorChoice ( choice) ) => choice,
13851385 _ => {
13861386 warn ! ( "Selective Color node properties panel could not be displayed." ) ;
13871387 return vec ! [ ] ;
@@ -1414,7 +1414,7 @@ pub(crate) fn selective_color_properties(node_id: NodeId, context: &mut NodeProp
14141414 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
14151415 return vec ! [ ] ;
14161416 } ;
1417- if let & Some ( & TaggedValue :: RelativeAbsolute ( relative_or_absolute) ) = & input. as_non_exposed_value ( ) {
1417+ if let Some ( & TaggedValue :: RelativeAbsolute ( relative_or_absolute) ) = input. as_non_exposed_value ( ) {
14181418 let entries = vec ! [
14191419 RadioEntryData :: new( "relative" )
14201420 . label( "Relative" )
@@ -1500,7 +1500,7 @@ pub(crate) fn rectangle_properties(node_id: NodeId, context: &mut NodeProperties
15001500 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
15011501 return vec ! [ ] ;
15021502 } ;
1503- if let & Some ( & TaggedValue :: Bool ( is_individual) ) = & input. as_non_exposed_value ( ) {
1503+ if let Some ( & TaggedValue :: Bool ( is_individual) ) = input. as_non_exposed_value ( ) {
15041504 // Values
15051505 let Some ( input) = document_node. inputs . get ( corner_radius_index) else {
15061506 log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
@@ -2221,15 +2221,14 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte
22212221
22222222 let mut widgets_first_row = start_widgets ( document_node, node_id, fill_index, "Fill" , FrontendGraphDataType :: General , true ) ;
22232223
2224- let ( fill, backup_color, backup_gradient) = match (
2224+ let ( fill, backup_color, backup_gradient) = if let ( Some ( TaggedValue :: Fill ( fill ) ) , & Some ( & TaggedValue :: OptionalColor ( backup_color ) ) , Some ( TaggedValue :: Gradient ( backup_gradient ) ) ) = (
22252225 & document_node. inputs [ fill_index] . as_value ( ) ,
22262226 & document_node. inputs [ backup_color_index] . as_value ( ) ,
22272227 & document_node. inputs [ backup_gradient_index] . as_value ( ) ,
22282228 ) {
2229- ( & Some ( TaggedValue :: Fill ( fill) ) , & Some ( & TaggedValue :: OptionalColor ( backup_color) ) , & Some ( TaggedValue :: Gradient ( backup_gradient) ) ) => ( fill, backup_color, backup_gradient) ,
2230- _ => {
2231- return vec ! [ LayoutGroup :: Row { widgets: widgets_first_row } ] ;
2232- }
2229+ ( fill, backup_color, backup_gradient)
2230+ } else {
2231+ return vec ! [ LayoutGroup :: Row { widgets: widgets_first_row } ] ;
22332232 } ;
22342233 let fill2 = fill. clone ( ) ;
22352234 let backup_color_fill: Fill = backup_color. into ( ) ;
0 commit comments