Skip to content

Commit c5cc412

Browse files
committed
Apply suggestions
1 parent bb670b9 commit c5cc412

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lib/query-planner/src/ast/operation.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,12 @@ impl PrettyDisplay for SubgraphFetchOperation {
129129

130130
impl Display for OperationDefinition {
131131
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
132-
if (self.operation_kind.is_none()
133-
|| self
134-
.operation_kind
135-
.as_ref()
136-
.is_none_or(|k| matches!(k, OperationKind::Query)))
137-
&& (self.name.is_none() || self.name.as_ref().is_none_or(|n| n.is_empty()))
138-
&& (self.variable_definitions.is_none()
139-
|| self
140-
.variable_definitions
141-
.as_ref()
142-
.is_none_or(|v| v.is_empty()))
132+
if self
133+
.operation_kind
134+
.as_ref()
135+
.is_none_or(|k| matches!(k, OperationKind::Query))
136+
&& self.name.as_deref().is_none_or(str::is_empty)
137+
&& self.variable_definitions.as_ref().is_none_or(Vec::is_empty)
143138
{
144139
// Short form for anonymous query
145140
return self.selection_set.fmt(f);

0 commit comments

Comments
 (0)