diff --git a/src/executor.rs b/src/executor.rs index be5f49f8..5fd307eb 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -27,7 +27,7 @@ pub struct Registry { #[derive(Clone)] pub enum FieldPath<'a> { Root(SourcePosition), - Field(String, SourcePosition, &'a FieldPath<'a>), + Field(&'a str, SourcePosition, &'a FieldPath<'a>), } /// Query execution engine @@ -187,7 +187,7 @@ impl<'a, CtxT> Executor<'a, CtxT> { #[doc(hidden)] pub fn sub_executor( &self, - field_name: Option, + field_name: Option<&'a str>, location: SourcePosition, selection_set: Option<&'a [Selection]>, ) @@ -251,7 +251,7 @@ impl<'a> FieldPath<'a> { FieldPath::Root(_) => (), FieldPath::Field(ref name, _, ref parent) => { parent.construct_path(acc); - acc.push(name.clone()); + acc.push((*name).to_owned()); } } } diff --git a/src/types/base.rs b/src/types/base.rs index 92cff735..2f3748b6 100644 --- a/src/types/base.rs +++ b/src/types/base.rs @@ -325,7 +325,7 @@ fn resolve_selection_set_into( let exec_vars = executor.variables(); let mut sub_exec = executor.sub_executor( - Some(response_name.clone()), + Some(response_name), start_pos.clone(), f.selection_set.as_ref().map(|v| &v[..]));