Skip to content

Commit cb0f08b

Browse files
committed
More fixes to compile on old rust versions
1 parent 3b3d041 commit cb0f08b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

juniper/src/types/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ fn is_excluded(directives: &Option<Vec<Spanning<Directive>>>, vars: &Variables)
503503
}
504504

505505
fn merge_key_into(result: &mut Object, response_name: &str, value: Value) {
506-
if let Some(&mut (_, ref mut e)) = result.iter_mut().find(|&(ref key, _)| key == response_name)
506+
if let Some(&mut (_, ref mut e)) = result.iter_mut().find(|&&mut (ref key, _)| key == response_name)
507507
{
508508
match *e {
509509
Value::Object(ref mut dest_obj) => {

juniper/src/value.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Object {
5151
if let Some(item) = self
5252
.key_value_list
5353
.iter_mut()
54-
.find(|(key, _)| (key as &str) == k)
54+
.find(|&(ref key, _)| (key as &str) == k)
5555
{
5656
return Some(::std::mem::replace(&mut item.1, value));
5757
}
@@ -66,7 +66,7 @@ impl Object {
6666
{
6767
self.key_value_list
6868
.iter()
69-
.any(|(key, _)| (key as &str) == f)
69+
.any(|&(ref key, _)| (key as &str) == f)
7070
}
7171

7272
/// Get a iterator over all field value pairs
@@ -103,7 +103,7 @@ impl Object {
103103
{
104104
self.key_value_list
105105
.iter()
106-
.find(|(k, _)| (k as &str) == key)
106+
.find(|&(ref k, _)| (k as &str) == key)
107107
.map(|&(_, ref value)| value)
108108
}
109109
}
@@ -143,7 +143,6 @@ where
143143
}
144144
}
145145

146-
147146
#[doc(hidden)]
148147
pub struct FieldIter<'a> {
149148
inner: ::std::slice::Iter<'a, (String, Value)>,
@@ -170,7 +169,6 @@ impl<'a> Iterator for FieldIterMut<'a> {
170169
}
171170
}
172171

173-
174172
impl Value {
175173
// CONSTRUCTORS
176174

@@ -275,7 +273,7 @@ impl ToInputValue for Value {
275273
),
276274
Value::Object(ref o) => InputValue::Object(
277275
o.iter()
278-
.map(|(k, v)| {
276+
.map(|&(ref k, ref v)| {
279277
(
280278
Spanning::unlocated(k.clone()),
281279
Spanning::unlocated(v.to_input_value()),

0 commit comments

Comments
 (0)