Skip to content

Commit dba8763

Browse files
committed
Fix format
1 parent 8add6f0 commit dba8763

1 file changed

Lines changed: 26 additions & 17 deletions

File tree

node-graph/node-macro/src/parsing.rs

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,19 @@ fn parse_field(pat_ident: PatIdent, ty: Type, attrs: &[Attribute]) -> syn::Resul
510510
// Validate data field attributes
511511
if is_data_field {
512512
if default_value.is_some() {
513-
return Err(Error::new_spanned(&pat_ident, "Data fields (#[data]) cannot have #[default] attribute. They are automatically initialized with Default::default()"));
513+
return Err(Error::new_spanned(
514+
&pat_ident,
515+
"Data fields (#[data]) cannot have #[default] attribute. They are automatically initialized with Default::default()",
516+
));
514517
}
515518
if scope.is_some() {
516519
return Err(Error::new_spanned(&pat_ident, "Data fields (#[data]) cannot have #[scope] attribute"));
517520
}
518521
if exposed {
519-
return Err(Error::new_spanned(&pat_ident, "Data fields (#[data]) cannot be exposed (#[expose]). They are internal state, not node parameters"));
522+
return Err(Error::new_spanned(
523+
&pat_ident,
524+
"Data fields (#[data]) cannot be exposed (#[expose]). They are internal state, not node parameters",
525+
));
520526
}
521527
}
522528

@@ -619,7 +625,10 @@ fn parse_field(pat_ident: PatIdent, ty: Type, attrs: &[Attribute]) -> syn::Resul
619625
if is_node {
620626
// Data fields cannot be impl Node types
621627
if is_data_field {
622-
return Err(Error::new_spanned(&ty, "Data fields (#[data]) cannot be of type `impl Node`. Data fields must be concrete types that implement Default"));
628+
return Err(Error::new_spanned(
629+
&ty,
630+
"Data fields (#[data]) cannot be of type `impl Node`. Data fields must be concrete types that implement Default",
631+
));
623632
}
624633

625634
let (input_type, output_type) = node_input_type
@@ -864,7 +873,7 @@ mod tests {
864873
properties_string: None,
865874
cfg: None,
866875
shader_node: None,
867-
serialize: None,
876+
serialize: None,
868877
},
869878
fn_name: Ident::new("add", Span::call_site()),
870879
struct_name: Ident::new("Add", Span::call_site()),
@@ -899,7 +908,7 @@ mod tests {
899908
number_display_decimal_places: None,
900909
number_step: None,
901910
unit: None,
902-
is_data_field: false,
911+
is_data_field: false,
903912
}],
904913
body: TokenStream2::new(),
905914
description: String::from("Multi\nLine\n"),
@@ -932,7 +941,7 @@ mod tests {
932941
properties_string: None,
933942
cfg: None,
934943
shader_node: None,
935-
serialize: None,
944+
serialize: None,
936945
},
937946
fn_name: Ident::new("transform", Span::call_site()),
938947
struct_name: Ident::new("Transform", Span::call_site()),
@@ -961,7 +970,7 @@ mod tests {
961970
number_display_decimal_places: None,
962971
number_step: None,
963972
unit: None,
964-
is_data_field: false,
973+
is_data_field: false,
965974
},
966975
ParsedField {
967976
pat_ident: pat_ident("translate"),
@@ -983,7 +992,7 @@ mod tests {
983992
number_display_decimal_places: None,
984993
number_step: None,
985994
unit: None,
986-
is_data_field: false,
995+
is_data_field: false,
987996
},
988997
],
989998
body: TokenStream2::new(),
@@ -1014,7 +1023,7 @@ mod tests {
10141023
properties_string: None,
10151024
cfg: None,
10161025
shader_node: None,
1017-
serialize: None,
1026+
serialize: None,
10181027
},
10191028
fn_name: Ident::new("circle", Span::call_site()),
10201029
struct_name: Ident::new("Circle", Span::call_site()),
@@ -1049,7 +1058,7 @@ mod tests {
10491058
number_display_decimal_places: None,
10501059
number_step: None,
10511060
unit: None,
1052-
is_data_field: false,
1061+
is_data_field: false,
10531062
}],
10541063
body: TokenStream2::new(),
10551064
description: "Test\n".into(),
@@ -1078,7 +1087,7 @@ mod tests {
10781087
properties_string: None,
10791088
cfg: None,
10801089
shader_node: None,
1081-
serialize: None,
1090+
serialize: None,
10821091
},
10831092
fn_name: Ident::new("levels", Span::call_site()),
10841093
struct_name: Ident::new("Levels", Span::call_site()),
@@ -1118,7 +1127,7 @@ mod tests {
11181127
number_display_decimal_places: None,
11191128
number_step: None,
11201129
unit: None,
1121-
is_data_field: false,
1130+
is_data_field: false,
11221131
}],
11231132
body: TokenStream2::new(),
11241133
description: String::new(),
@@ -1154,7 +1163,7 @@ mod tests {
11541163
properties_string: None,
11551164
cfg: None,
11561165
shader_node: None,
1157-
serialize: None,
1166+
serialize: None,
11581167
},
11591168
fn_name: Ident::new("add", Span::call_site()),
11601169
struct_name: Ident::new("Add", Span::call_site()),
@@ -1189,7 +1198,7 @@ mod tests {
11891198
number_display_decimal_places: None,
11901199
number_step: None,
11911200
unit: None,
1192-
is_data_field: false,
1201+
is_data_field: false,
11931202
}],
11941203
body: TokenStream2::new(),
11951204
description: String::new(),
@@ -1218,7 +1227,7 @@ mod tests {
12181227
properties_string: None,
12191228
cfg: None,
12201229
shader_node: None,
1221-
serialize: None,
1230+
serialize: None,
12221231
},
12231232
fn_name: Ident::new("load_image", Span::call_site()),
12241233
struct_name: Ident::new("LoadImage", Span::call_site()),
@@ -1253,7 +1262,7 @@ mod tests {
12531262
number_display_decimal_places: None,
12541263
number_step: None,
12551264
unit: None,
1256-
is_data_field: false,
1265+
is_data_field: false,
12571266
}],
12581267
body: TokenStream2::new(),
12591268
description: String::new(),
@@ -1282,7 +1291,7 @@ mod tests {
12821291
properties_string: None,
12831292
cfg: None,
12841293
shader_node: None,
1285-
serialize: None,
1294+
serialize: None,
12861295
},
12871296
fn_name: Ident::new("custom_node", Span::call_site()),
12881297
struct_name: Ident::new("CustomNode", Span::call_site()),

0 commit comments

Comments
 (0)