summaryrefslogtreecommitdiff
path: root/src/nibble/convert.rs
diff options
context:
space:
mode:
authorGreg Brown <gmb60@cam.ac.uk>2021-01-19 22:37:35 +0000
committerGreg Brown <gmb60@cam.ac.uk>2021-01-19 22:38:45 +0000
commit8f7a17e0f48e3586fae619be08351c6761b07596 (patch)
tree0fe2c78b93cdfcbe7b6621c272c8b73eacfc53c4 /src/nibble/convert.rs
parentf6916209d57682493288ab42e695204b95d0ba23 (diff)
Remove usage of `extra-traits` feature of syn.
Diffstat (limited to 'src/nibble/convert.rs')
-rw-r--r--src/nibble/convert.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nibble/convert.rs b/src/nibble/convert.rs
index e3c8bfc..f7c20be 100644
--- a/src/nibble/convert.rs
+++ b/src/nibble/convert.rs
@@ -206,25 +206,25 @@ impl Convert for Cat {
let mut iter = self.0.into_pairs();
let (first, punct) = match iter.next().unwrap() {
- Pair::Punctuated(t, p) => (t.convert(context)?, Some(p)),
+ Pair::Punctuated(t, p) => (t.convert(context)?, Some(p.span)),
Pair::End(t) => (t.convert(context)?, None),
};
let mut rest = Vec::new();
let (span, _) = iter.try_fold(
(
- first.span.and_then(|s| punct.and_then(|p| s.join(p.span))),
+ first.span.and_then(|s| punct.and_then(|p| s.join(p))),
punct,
),
|(span, punct), pair| {
let (snd, p) = match pair {
- Pair::Punctuated(t, p) => (t.convert(context)?, Some(p)),
+ Pair::Punctuated(t, p) => (t.convert(context)?, Some(p.span)),
Pair::End(t) => (t.convert(context)?, None),
};
let span = span
.and_then(|s| snd.span.and_then(|t| s.join(t)))
- .and_then(|s| p.and_then(|p| s.join(p.span)));
+ .and_then(|s| p.and_then(|p| s.join(p)));
rest.push((punct, snd));
Ok((span, p))
},
@@ -268,25 +268,25 @@ impl Convert for Alt {
let mut iter = self.0.into_pairs();
let (first, punct) = match iter.next().unwrap() {
- Pair::Punctuated(t, p) => (t.convert(context)?, Some(p)),
+ Pair::Punctuated(t, p) => (t.convert(context)?, Some(p.span)),
Pair::End(t) => (t.convert(context)?, None),
};
let mut rest = Vec::new();
let (span, _) = iter.try_fold(
(
- first.span.and_then(|s| punct.and_then(|p| s.join(p.span))),
+ first.span.and_then(|s| punct.and_then(|p| s.join(p))),
punct,
),
|(span, punct), pair| {
let (snd, p) = match pair {
- Pair::Punctuated(t, p) => (t.convert(context)?, Some(p)),
+ Pair::Punctuated(t, p) => (t.convert(context)?, Some(p.span)),
Pair::End(t) => (t.convert(context)?, None),
};
let span = span
.and_then(|s| snd.span.and_then(|t| s.join(t)))
- .and_then(|s| p.and_then(|p| s.join(p.span)));
+ .and_then(|s| p.and_then(|p| s.join(p)));
rest.push((punct, snd));
Ok((span, p))
},