Replace WithLocation::new with .map(|x| x.0)
Summary: * Slight cleanup
@@ -11,7 +11,6 @@ use std::fmt::Result as FmtResult;
use std::fmt::Write;
use std::path::Path;
-use common::WithLocation;
use fnv::FnvBuildHasher;
use fnv::FnvHashSet;
use graphql_ir::FragmentDefinition;
@@ -140,7 +139,7 @@ impl<'p> Printer<'p> {
schema,
&mut self.builder,
operation,
- WithLocation::new(operation.name.location, operation.name.item.0),
+ operation.name.map(|x| x.0),
self.project_config,
)?;
let printer = JSONPrinter::new(&self.builder, self.project_config, top_level_statements);
@@ -188,7 +187,7 @@ impl<'p> Printer<'p> {
&mut self.builder,
operation,
top_level_statements,
- WithLocation::new(operation.name.location, operation.name.item.0),
+ operation.name.map(|x| x.0),
self.project_config,
);
@@ -215,7 +214,7 @@ impl<'p> Printer<'p> {
schema,
&mut self.builder,
operation,
- WithLocation::new(operation.name.location, operation.name.item.0),
+ operation.name.map(|x| x.0),
self.project_config,
);
let printer = JSONPrinter::new(&self.builder, self.project_config, top_level_statements);
@@ -252,7 +251,7 @@ impl<'p> Printer<'p> {
&mut self.builder,
operation,
top_level_statements,
- WithLocation::new(operation.name.location, operation.name.item.0),
+ operation.name.map(|x| x.0),
self.project_config,
);
let printer = JSONPrinter::new(&self.builder, self.project_config, top_level_statements);
