We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8aac107 commit 2c4cffdCopy full SHA for 2c4cffd
src/libcore/iter/adapters/chain.rs
@@ -130,17 +130,16 @@ where
130
131
#[inline]
132
fn last(self) -> Option<A::Item> {
133
- match self {
134
- Chain { a: Some(a), b: Some(b) } => {
135
- // Must exhaust a before b.
136
- let a_last = a.last();
137
- let b_last = b.last();
138
- b_last.or(a_last)
139
- }
140
- Chain { a: Some(a), b: None } => a.last(),
141
- Chain { a: None, b: Some(b) } => b.last(),
142
- Chain { a: None, b: None } => None,
143
+ // Must exhaust a before b.
+ let a_last = match self.a {
+ Some(a) => a.last(),
+ None => None,
+ };
+ let b_last = match self.b {
+ Some(b) => b.last(),
+ b_last.or(a_last)
144
}
145
146
0 commit comments