From 0b274426b1f8e34aeb9441cca436e5c5e9e30641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Wed, 6 Nov 2024 16:15:22 +0100 Subject: [PATCH] fmt --- apollo-federation/src/operation/merging.rs | 2 +- apollo-federation/src/query_graph/mod.rs | 36 +++++++++---------- .../src/query_plan/conditions.rs | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apollo-federation/src/operation/merging.rs b/apollo-federation/src/operation/merging.rs index afd1f141de..e7ebb8b63b 100644 --- a/apollo-federation/src/operation/merging.rs +++ b/apollo-federation/src/operation/merging.rs @@ -15,9 +15,9 @@ use super::NamedFragments; use super::Selection; use super::SelectionSet; use super::SelectionValue; +use crate::bail; use crate::ensure; use crate::error::FederationError; -use crate::bail; impl<'a> FieldSelectionValue<'a> { /// Merges the given field selections into this one. diff --git a/apollo-federation/src/query_graph/mod.rs b/apollo-federation/src/query_graph/mod.rs index 19ddb7d81c..736f7af567 100644 --- a/apollo-federation/src/query_graph/mod.rs +++ b/apollo-federation/src/query_graph/mod.rs @@ -369,27 +369,27 @@ impl QueryGraph { } pub(crate) fn node_weight(&self, node: NodeIndex) -> Result<&QueryGraphNode, FederationError> { - self.graph.node_weight(node).ok_or_else(|| { - internal_error!("Node unexpectedly missing") - }) + self.graph + .node_weight(node) + .ok_or_else(|| internal_error!("Node unexpectedly missing")) } fn node_weight_mut(&mut self, node: NodeIndex) -> Result<&mut QueryGraphNode, FederationError> { - self.graph.node_weight_mut(node).ok_or_else(|| { - internal_error!("Node unexpectedly missing") - }) + self.graph + .node_weight_mut(node) + .ok_or_else(|| internal_error!("Node unexpectedly missing")) } pub(crate) fn edge_weight(&self, edge: EdgeIndex) -> Result<&QueryGraphEdge, FederationError> { - self.graph.edge_weight(edge).ok_or_else(|| { - internal_error!("Edge unexpectedly missing") - }) + self.graph + .edge_weight(edge) + .ok_or_else(|| internal_error!("Edge unexpectedly missing")) } fn edge_weight_mut(&mut self, edge: EdgeIndex) -> Result<&mut QueryGraphEdge, FederationError> { - self.graph.edge_weight_mut(edge).ok_or_else(|| { - internal_error!("Edge unexpectedly missing") - }) + self.graph + .edge_weight_mut(edge) + .ok_or_else(|| internal_error!("Edge unexpectedly missing")) } pub(crate) fn edge_head_weight( @@ -404,9 +404,9 @@ impl QueryGraph { &self, edge: EdgeIndex, ) -> Result<(NodeIndex, NodeIndex), FederationError> { - self.graph.edge_endpoints(edge).ok_or_else(|| { - internal_error!("Edge unexpectedly missing") - }) + self.graph + .edge_endpoints(edge) + .ok_or_else(|| internal_error!("Edge unexpectedly missing")) } fn schema(&self) -> Result<&ValidFederationSchema, FederationError> { @@ -417,9 +417,9 @@ impl QueryGraph { &self, source: &str, ) -> Result<&ValidFederationSchema, FederationError> { - self.sources.get(source).ok_or_else(|| { - internal_error!(r#"Schema for "{source}" unexpectedly missing"#) - }) + self.sources + .get(source) + .ok_or_else(|| internal_error!(r#"Schema for "{source}" unexpectedly missing"#)) } pub(crate) fn subgraph_schemas(&self) -> &IndexMap, ValidFederationSchema> { diff --git a/apollo-federation/src/query_plan/conditions.rs b/apollo-federation/src/query_plan/conditions.rs index 8efc78cadd..f202fd4058 100644 --- a/apollo-federation/src/query_plan/conditions.rs +++ b/apollo-federation/src/query_plan/conditions.rs @@ -8,8 +8,8 @@ use apollo_compiler::Node; use indexmap::map::Entry; use serde::Serialize; -use crate::error::FederationError; use crate::bail; +use crate::error::FederationError; use crate::operation::DirectiveList; use crate::operation::NamedFragments; use crate::operation::Selection;