Skip to content

Commit 49d2b8f

Browse files
committed
Fix Clippy warnings
1 parent 25260a2 commit 49d2b8f

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

Diff for: src/sql/execution/aggregation.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ impl<T: Transaction> Executor<T> for Aggregation<T> {
4949
.map(|(i, c)| if i < agg_count { Column { name: None } } else { c })
5050
.collect(),
5151
rows: Box::new(self.accumulators.into_iter().map(|(bucket, accs)| {
52-
Ok(accs
53-
.into_iter()
54-
.map(|acc| acc.aggregate())
55-
.chain(bucket.into_iter())
56-
.collect())
52+
Ok(accs.into_iter().map(|acc| acc.aggregate()).chain(bucket).collect())
5753
})),
5854
})
5955
}

Diff for: src/sql/types/expression.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl Expression {
140140
expr => return Err(Error::Value(format!("Can't take the positive of {}", expr))),
141141
},
142142
Self::Divide(lhs, rhs) => match (lhs.evaluate(row)?, rhs.evaluate(row)?) {
143-
(Integer(_), Integer(rhs)) if rhs == 0 => {
143+
(Integer(_), Integer(0)) => {
144144
return Err(Error::Value("Can't divide by zero".into()))
145145
}
146146
(Integer(lhs), Integer(rhs)) => Integer(lhs / rhs),
@@ -184,7 +184,7 @@ impl Expression {
184184
},
185185
Self::Modulo(lhs, rhs) => match (lhs.evaluate(row)?, rhs.evaluate(row)?) {
186186
// This uses remainder semantics, like Postgres.
187-
(Integer(_), Integer(rhs)) if rhs == 0 => {
187+
(Integer(_), Integer(0)) => {
188188
return Err(Error::Value("Can't divide by zero".into()))
189189
}
190190
(Integer(lhs), Integer(rhs)) => Integer(lhs % rhs),

Diff for: src/storage/mvcc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ pub mod tests {
15001500
// Full scans at all timestamps.
15011501
for version in 1..5 {
15021502
let txn = match version {
1503-
v if v == 5 => mvcc.begin_read_only()?,
1503+
5 => mvcc.begin_read_only()?,
15041504
v => mvcc.begin_as_of(v)?,
15051505
};
15061506
let mut scan = txn.scan(..)?; // see golden master
@@ -1555,7 +1555,7 @@ pub mod tests {
15551555
// Full scans at all timestamps.
15561556
for version in 1..5 {
15571557
let txn = match version {
1558-
v if v == 5 => mvcc.begin_read_only()?,
1558+
5 => mvcc.begin_read_only()?,
15591559
v => mvcc.begin_as_of(v)?,
15601560
};
15611561
let mut scan = txn.scan_prefix(&[])?; // see golden master

Diff for: tests/client/pool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async fn get() -> Result<()> {
2424

2525
let mut servers = HashSet::new();
2626
let mut ids = HashSet::new();
27-
for client in vec![a, b, c, d, e] {
27+
for client in [a, b, c, d, e] {
2828
servers.insert(client.status().await?.raft.server);
2929
ids.insert(client.id());
3030
}

0 commit comments

Comments
 (0)