From 0366be1960b065a492c9dacb2cdb7169d854aea7 Mon Sep 17 00:00:00 2001 From: Tyler K Date: Fri, 25 Oct 2024 13:30:42 -0700 Subject: [PATCH] Formatting --- tool/src/demo_gen/terminus.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tool/src/demo_gen/terminus.rs b/tool/src/demo_gen/terminus.rs index 1d7dc4781..b9f101595 100644 --- a/tool/src/demo_gen/terminus.rs +++ b/tool/src/demo_gen/terminus.rs @@ -45,7 +45,7 @@ struct MethodDependency { params: Vec, /// The type name that this method belongs to. Currently used by [`OutParam`] for better default parameter names. - owning_type : String, + owning_type: String, } pub(super) struct RenderTerminusContext<'ctx, 'tcx> { @@ -63,7 +63,7 @@ impl MethodDependency { MethodDependency { method_js, params: Vec::new(), - owning_type + owning_type, } } } @@ -159,8 +159,10 @@ impl<'ctx, 'tcx> RenderTerminusContext<'ctx, 'tcx> { // Not making this as part of the RenderTerminusContext because we want each evaluation to have a specific node, // which I find easier easier to represent as a parameter to each function than something like an updating the current node in the struct. - let mut root = - MethodDependency::new(self.get_constructor_js(type_name.clone(), method), type_name.clone()); + let mut root = MethodDependency::new( + self.get_constructor_js(type_name.clone(), method), + type_name.clone(), + ); // And then we just treat the terminus as a regular constructor method: self.terminus_info.node_call_stack = self.evaluate_constructor(method, &mut root); @@ -193,7 +195,12 @@ impl<'ctx, 'tcx> RenderTerminusContext<'ctx, 'tcx> { let attrs_default = attrs.unwrap_or_default(); // This only works for enums, since otherwise we break the type into its component parts. let label = if attrs_default.input_cfg.label.is_empty() { - format!("{}:{}", heck::AsUpperCamelCase(node.owning_type.clone()), heck::AsUpperCamelCase(param_name.clone())).to_string() + format!( + "{}:{}", + heck::AsUpperCamelCase(node.owning_type.clone()), + heck::AsUpperCamelCase(param_name.clone()) + ) + .to_string() } else { attrs_default.input_cfg.label }; @@ -371,8 +378,10 @@ impl<'ctx, 'tcx> RenderTerminusContext<'ctx, 'tcx> { self.relative_import_path.clone(), )); - let mut child = - MethodDependency::new(self.get_constructor_js(type_name.to_string(), method), type_name); + let mut child = MethodDependency::new( + self.get_constructor_js(type_name.to_string(), method), + type_name, + ); let call = self.evaluate_constructor(method, &mut child); node.params.push(ParamInfo { js: call });