Format with rustfmt 2019-08-03

This commit is contained in:
David Tolnay 2019-08-07 01:12:19 -07:00
parent d3a56c9eb4
commit 23e58c92a5
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 10 additions and 16 deletions

View File

@ -261,9 +261,7 @@ impl<'a> Cursor<'a> {
pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> {
self.ignore_none();
match self.entry() {
Entry::Punct(op) if op.as_char() != '\'' => {
Some((op.clone(), unsafe { self.bump() }))
}
Entry::Punct(op) if op.as_char() != '\'' => Some((op.clone(), unsafe { self.bump() })),
_ => None,
}
}

View File

@ -464,11 +464,10 @@ impl<'a, T, P> Iterator for Pairs<'a, T, P> {
impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P> {
fn next_back(&mut self) -> Option<Self::Item> {
self.last.next().map(Pair::End).or_else(|| {
self.inner
.next_back()
.map(|(t, p)| Pair::Punctuated(t, p))
})
self.last
.next()
.map(Pair::End)
.or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
}
}
@ -511,11 +510,10 @@ impl<'a, T, P> Iterator for PairsMut<'a, T, P> {
impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P> {
fn next_back(&mut self) -> Option<Self::Item> {
self.last.next().map(Pair::End).or_else(|| {
self.inner
.next_back()
.map(|(t, p)| Pair::Punctuated(t, p))
})
self.last
.next()
.map(Pair::End)
.or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
}
}

View File

@ -39,9 +39,7 @@ impl<'a> PartialEq for TokenTreeHelper<'a> {
_ => false,
}
}
(TokenTree::Literal(l1), TokenTree::Literal(l2)) => {
l1.to_string() == l2.to_string()
}
(TokenTree::Literal(l1), TokenTree::Literal(l2)) => l1.to_string() == l2.to_string(),
(TokenTree::Ident(s1), TokenTree::Ident(s2)) => s1 == s2,
_ => false,
}