Skip to content

Commit fab48f7

Browse files
committed
Fix Clippy warning
1 parent c2af968 commit fab48f7

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/client/connect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::{
2424
};
2525

2626
#[pin_project(project = RespConnectionInnerProj)]
27+
#[expect(clippy::large_enum_variant, reason = "will only be enabled if selected, and isn't moved once built")]
2728
pub enum RespConnectionInner {
2829
#[cfg(feature = "with-rustls")]
2930
Tls {

src/client/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
//! This contains three main functions that return three specific types of client:
1414
//!
1515
//! * `connect` returns a pair of `Stream` and `Sink`, clients can write RESP messages to the
16-
//! `Sink` and read RESP messages from the `Stream`. Pairing requests to responses is up to the
17-
//! client. This is intended to be a low-level interface from which more user-friendly interfaces
18-
//! can be built.
16+
//! `Sink` and read RESP messages from the `Stream`. Pairing requests to responses is up to the
17+
//! client. This is intended to be a low-level interface from which more user-friendly interfaces
18+
//! can be built.
1919
//! * `paired_connect` is used for most of the standard Redis commands, where one request results
20-
//! in one response.
20+
//! in one response.
2121
//! * `pubsub_connect` is used for Redis's PUBSUB functionality.
2222
2323
pub mod connect;

src/resp.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ macro_rules! impl_fromresp_integers {
182182
i64::from_resp_int(resp).and_then(|x| {
183183
// $int_ty::max_value() as i64 > 0 should be optimized out. It tests if
184184
// the target integer type needs an "upper bounds" check
185-
if x < ($int_ty::min_value() as i64)
186-
|| ($int_ty::max_value() as i64 > 0
187-
&& x > ($int_ty::max_value() as i64))
185+
if x < ($int_ty::MIN as i64)
186+
|| ($int_ty::MAX as i64 > 0
187+
&& x > ($int_ty::MAX as i64))
188188
{
189189
Err(error::resp(
190190
concat!(
@@ -424,23 +424,23 @@ impl IntoRespString for String {
424424
}
425425
string_into_resp!(String);
426426

427-
impl<'a> IntoRespString for &'a String {
427+
impl IntoRespString for &String {
428428
#[inline]
429429
fn into_resp_string(self) -> RespValue {
430430
RespValue::BulkString(self.as_bytes().into())
431431
}
432432
}
433433
string_into_resp!(&'a String);
434434

435-
impl<'a> IntoRespString for &'a str {
435+
impl IntoRespString for &str {
436436
#[inline]
437437
fn into_resp_string(self) -> RespValue {
438438
RespValue::BulkString(self.as_bytes().into())
439439
}
440440
}
441441
string_into_resp!(&'a str);
442442

443-
impl<'a> IntoRespString for &'a [u8] {
443+
impl IntoRespString for &[u8] {
444444
#[inline]
445445
fn into_resp_string(self) -> RespValue {
446446
RespValue::BulkString(self.to_vec())
@@ -814,7 +814,7 @@ mod tests {
814814

815815
#[test]
816816
fn test_integer_overflow() {
817-
let resp_object = RespValue::Integer(i64::max_value());
817+
let resp_object = RespValue::Integer(i64::MAX);
818818
let res = i32::from_resp(resp_object);
819819
assert!(res.is_err());
820820
}

0 commit comments

Comments
 (0)