From 208f22d52e2b8090797d370cc053cfe01971caf9 Mon Sep 17 00:00:00 2001 From: dariuszkuc <9501705+dariuszkuc@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:18:27 -0600 Subject: [PATCH] remove unnecessary Result (again...) --- apollo-federation/src/operation/optimize.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apollo-federation/src/operation/optimize.rs b/apollo-federation/src/operation/optimize.rs index e30b7f57a8..d9b0514114 100644 --- a/apollo-federation/src/operation/optimize.rs +++ b/apollo-federation/src/operation/optimize.rs @@ -144,7 +144,7 @@ impl Operation { /// occur multiple times in the operation. pub(crate) fn generate_fragments_v2(&mut self) -> Result<(), FederationError> { let mut generator = FragmentGenerator::default(); - generator.collect_selection_usages(&self.selection_set)?; + generator.collect_selection_usages(&self.selection_set); generator.minify(&mut self.selection_set)?; self.named_fragments = generator.into_minimized(); Ok(()) @@ -367,18 +367,18 @@ impl FragmentGenerator { fn collect_selection_usages( &mut self, selection_set: &SelectionSet, - ) -> Result<(), FederationError> { + ) { for selection in selection_set.selections.values() { match selection { Selection::Field(field) => { if let Some(selection_set) = &field.selection_set { self.increment_selection_count(selection_set); - self.collect_selection_usages(selection_set)?; + self.collect_selection_usages(selection_set); } } Selection::InlineFragment(frag) => { self.increment_selection_count(&frag.selection_set); - self.collect_selection_usages(&frag.selection_set)?; + self.collect_selection_usages(&frag.selection_set); } Selection::FragmentSpread(_) => { // nothing to here as it is already a fragment spread @@ -387,7 +387,6 @@ impl FragmentGenerator { } } } - Ok(()) } /// Recursively iterates over all selections to check if their selection sets are used multiple