Skip to content

Commit 564e62e

Browse files
authored
fix: make clippy happy (#41)
Signed-off-by: Chojan Shang <[email protected]>
1 parent b44c9d1 commit 564e62e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

clickhouse/src/types/decimal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl Decimal {
200200
}
201201

202202
let underlying = source.scale(FACTORS10[scale as usize]);
203-
if underlying > FACTORS10[precision as usize] as i64 {
203+
if underlying > FACTORS10[precision as usize] {
204204
panic!("{} > {}", underlying, FACTORS10[precision as usize]);
205205
}
206206

mysql/src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn client_handshake(i: &[u8], after_tls: bool) -> nom::IResult<&[u8], Client
4040
let (i, cap2) = nom::number::complete::le_u16(i)?;
4141
let cap = (cap2 as u32) << 16 | cap as u32;
4242

43-
capabilities = CapabilityFlags::from_bits_truncate(cap as u32);
43+
capabilities = CapabilityFlags::from_bits_truncate(cap);
4444

4545
let (i, maxps) = nom::number::complete::le_u32(i)?;
4646
let (i, collation) = nom::bytes::complete::take(1u8)(i)?;

mysql/src/params.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ impl<'a> Iterator for Params<'a> {
8787
self.bound_types.clear();
8888
for i in 0..self.params as usize {
8989
self.bound_types.push((
90-
myc::constants::ColumnType::try_from(typmap[2 * i as usize])
91-
.unwrap_or_else(|e| {
92-
panic!("bad column type 0x{:x}: {}", typmap[2 * i as usize], e)
93-
}),
94-
(typmap[2 * i as usize + 1] & 128) != 0,
90+
myc::constants::ColumnType::try_from(typmap[2 * i]).unwrap_or_else(|e| {
91+
panic!("bad column type 0x{:x}: {}", typmap[2 * i], e)
92+
}),
93+
(typmap[2 * i + 1] & 128) != 0,
9594
));
9695
}
9796
self.input = rest;

0 commit comments

Comments
 (0)