Skip to content

Commit 1f31219

Browse files
committed
Fix a few nits pointed out by clippy
- ...::max_value() -> ..::MAX - delete explicit import of signed integer types
1 parent f9c2d5c commit 1f31219

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

postgres-protocol/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ macro_rules! from_usize {
6060
impl FromUsize for $t {
6161
#[inline]
6262
fn from_usize(x: usize) -> io::Result<$t> {
63-
if x > <$t>::max_value() as usize {
63+
if x > <$t>::MAX as usize {
6464
Err(io::Error::new(
6565
io::ErrorKind::InvalidInput,
6666
"value too large to transmit",

postgres-types/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ impl ToSql for IpAddr {
12221222
}
12231223

12241224
fn downcast(len: usize) -> Result<i32, Box<dyn Error + Sync + Send>> {
1225-
if len > i32::max_value() as usize {
1225+
if len > i32::MAX as usize {
12261226
Err("value too large to transmit".into())
12271227
} else {
12281228
Ok(len as i32)

postgres-types/src/special.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use bytes::BytesMut;
22
use postgres_protocol::types;
33
use std::error::Error;
4-
use std::{i32, i64};
54

65
use crate::{FromSql, IsNull, ToSql, Type};
76

0 commit comments

Comments
 (0)