From 94bbee201896912c169627c06cc20cc1cbdec85f Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 21 Jun 2024 22:13:16 +0200 Subject: [PATCH] format --- rs/proposals/src/canisters/nns_registry/api.rs | 14 +++++++++++--- scripts/did2rs.sh | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rs/proposals/src/canisters/nns_registry/api.rs b/rs/proposals/src/canisters/nns_registry/api.rs index 7c578c9a326..18b69985606 100644 --- a/rs/proposals/src/canisters/nns_registry/api.rs +++ b/rs/proposals/src/canisters/nns_registry/api.rs @@ -449,7 +449,10 @@ impl Service { pub async fn create_subnet(&self, arg0: CreateSubnetPayload) -> CallResult<()> { ic_cdk::call(self.0, "create_subnet", (arg0,)).await } - pub async fn deploy_guestos_to_all_subnet_nodes(&self, arg0: DeployGuestosToAllSubnetNodesPayload) -> CallResult<()> { + pub async fn deploy_guestos_to_all_subnet_nodes( + &self, + arg0: DeployGuestosToAllSubnetNodesPayload, + ) -> CallResult<()> { ic_cdk::call(self.0, "deploy_guestos_to_all_subnet_nodes", (arg0,)).await } pub async fn deploy_guestos_to_all_unassigned_nodes( @@ -467,7 +470,9 @@ impl Service { ) -> CallResult<(GetNodeOperatorsAndDcsOfNodeProviderResponse,)> { ic_cdk::call(self.0, "get_node_operators_and_dcs_of_node_provider", (arg0,)).await } - pub async fn get_node_providers_monthly_xdr_rewards(&self) -> CallResult<(GetNodeProvidersMonthlyXdrRewardsResponse,)> { + pub async fn get_node_providers_monthly_xdr_rewards( + &self, + ) -> CallResult<(GetNodeProvidersMonthlyXdrRewardsResponse,)> { ic_cdk::call(self.0, "get_node_providers_monthly_xdr_rewards", ()).await } pub async fn get_subnet_for_canister( @@ -512,7 +517,10 @@ impl Service { pub async fn set_firewall_config(&self, arg0: SetFirewallConfigPayload) -> CallResult<()> { ic_cdk::call(self.0, "set_firewall_config", (arg0,)).await } - pub async fn update_api_boundary_nodes_version(&self, arg0: UpdateApiBoundaryNodesVersionPayload) -> CallResult<()> { + pub async fn update_api_boundary_nodes_version( + &self, + arg0: UpdateApiBoundaryNodesVersionPayload, + ) -> CallResult<()> { ic_cdk::call(self.0, "update_api_boundary_nodes_version", (arg0,)).await } pub async fn update_elected_hostos_versions(&self, arg0: UpdateElectedHostosVersionsPayload) -> CallResult<()> { diff --git a/scripts/did2rs.sh b/scripts/did2rs.sh index 9cde90a4d19..65d9390909f 100755 --- a/scripts/did2rs.sh +++ b/scripts/did2rs.sh @@ -153,7 +153,8 @@ cd "$GIT_ROOT" # Replace invalid "{}" in generated Rust code with "EmptyRecord": /^pub (struct|enum) /,/^}/{s/ *\{\},$/(EmptyRecord),/g}; ' | - "$sed" -z 's/candid::define_function!(pub \([^ ]*\) [^;]*;\n#\[derive([^)]*)\]/pub type \1 = candid::Func;\n#[derive(CandidType, Deserialize)]/g' + "$sed" -z 's/candid::define_function!(pub \([^ ]*\) [^;]*;\n#\[derive([^)]*)\]/pub type \1 = candid::Func;\n#[derive(CandidType, Deserialize)]/g' | + rustfmt --edition 2021 } >"${RUST_PATH}" if test -f "${EDIT_PATH}"; then (