Skip to content

Commit

Permalink
Fix a few nits pointed out by clippy
Browse files Browse the repository at this point in the history
- ...::max_value() -> ..::MAX
- delete explicit import of signed integer types
  • Loading branch information
cammeresi committed Jul 6, 2024
1 parent f9c2d5c commit 1f31219
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion postgres-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ macro_rules! from_usize {
impl FromUsize for $t {
#[inline]
fn from_usize(x: usize) -> io::Result<$t> {
if x > <$t>::max_value() as usize {
if x > <$t>::MAX as usize {
Err(io::Error::new(
io::ErrorKind::InvalidInput,
"value too large to transmit",
Expand Down
2 changes: 1 addition & 1 deletion postgres-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ impl ToSql for IpAddr {
}

fn downcast(len: usize) -> Result<i32, Box<dyn Error + Sync + Send>> {
if len > i32::max_value() as usize {
if len > i32::MAX as usize {
Err("value too large to transmit".into())
} else {
Ok(len as i32)
Expand Down
1 change: 0 additions & 1 deletion postgres-types/src/special.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bytes::BytesMut;
use postgres_protocol::types;
use std::error::Error;
use std::{i32, i64};

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

Expand Down

0 comments on commit 1f31219

Please sign in to comment.