Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Aug 2, 2024
1 parent be85cbf commit ec2f9c4
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 140 deletions.
48 changes: 24 additions & 24 deletions sea-query-binder/src/sqlx_any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,86 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues {
use sqlx::Arguments;
match arg {
Value::Bool(b) => {
args.add(b);
let _ = args.add(b);
}
Value::TinyInt(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::SmallInt(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::Int(i) => {
args.add(i);
let _ = args.add(i);
}
Value::BigInt(i) => {
args.add(i);
let _ = args.add(i);
}
Value::TinyUnsigned(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::SmallUnsigned(i) => {
args.add(i.map(Into::<i32>::into));
let _ = args.add(i.map(Into::<i32>::into));
}
Value::Unsigned(i) => {
args.add(i.map(Into::<i64>::into));
let _ = args.add(i.map(Into::<i64>::into));
}
Value::BigUnsigned(i) => {
args.add(i.map(|i| <i64 as std::convert::TryFrom<u64>>::try_from(i).unwrap()));
let _ = args.add(i.map(|i| <i64 as std::convert::TryFrom<u64>>::try_from(i).unwrap()));
}
Value::Float(f) => {
args.add(f);
let _ = args.add(f);
}
Value::Double(d) => {
args.add(d);
let _ = args.add(d);
}
Value::String(s) => {
args.add(s.map(|s| *s));
let _ = args.add(s.map(|s| *s));
}
Value::Char(c) => {
args.add(c.map(|c| c.to_string()));
let _ = args.add(c.map(|c| c.to_string()));
}
Value::Bytes(b) => {
args.add(b.map(|b| *b));
let _ = args.add(b.map(|b| *b));
}
#[cfg(feature = "with-chrono")]
Value::ChronoDate(t) => {
args.add(Value::ChronoDate(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDate(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoTime(t) => {
args.add(Value::ChronoTime(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoTime(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTime(t) => {
args.add(Value::ChronoDateTime(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTime(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeUtc(t) => {
args.add(Value::ChronoDateTimeUtc(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTimeUtc(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeLocal(t) => {
args.add(Value::ChronoDateTimeLocal(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTimeLocal(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeWithTimeZone(t) => {
args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDate(t) => {
args.add(Value::TimeDate(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeDate(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeTime(t) => {
args.add(Value::TimeTime(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeTime(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDateTime(t) => {
args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDateTimeWithTimeZone(t) => {
args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string());
let _ = args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-uuid")]
Value::Uuid(_) => {
Expand Down
56 changes: 28 additions & 28 deletions sea-query-binder/src/sqlx_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,102 +8,102 @@ impl sqlx::IntoArguments<'_, sqlx::mysql::MySql> for SqlxValues {
use sqlx::Arguments;
match arg {
Value::Bool(b) => {
args.add(b);
let _ = args.add(b);
}
Value::TinyInt(i) => {
args.add(i);
let _ = args.add(i);
}
Value::SmallInt(i) => {
args.add(i);
let _ = args.add(i);
}
Value::Int(i) => {
args.add(i);
let _ = args.add(i);
}
Value::BigInt(i) => {
args.add(i);
let _ = args.add(i);
}
Value::TinyUnsigned(i) => {
args.add(i);
let _ = args.add(i);
}
Value::SmallUnsigned(i) => {
args.add(i);
let _ = args.add(i);
}
Value::Unsigned(i) => {
args.add(i);
let _ = args.add(i);
}
Value::BigUnsigned(i) => {
args.add(i);
let _ = args.add(i);
}
Value::Float(f) => {
args.add(f);
let _ = args.add(f);
}
Value::Double(d) => {
args.add(d);
let _ = args.add(d);
}
Value::String(s) => {
args.add(s.as_deref());
let _ = args.add(s.as_deref());
}
Value::Char(c) => {
args.add(c.map(|c| c.to_string()));
let _ = args.add(c.map(|c| c.to_string()));
}
Value::Bytes(b) => {
args.add(b.as_deref());
let _ = args.add(b.as_deref());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDate(d) => {
args.add(d.as_deref());
let _ = args.add(d.as_deref());
}
#[cfg(feature = "with-chrono")]
Value::ChronoTime(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTime(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeUtc(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeLocal(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-chrono")]
Value::ChronoDateTimeWithTimeZone(t) => {
args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
let _ = args.add(Value::ChronoDateTimeWithTimeZone(t).chrono_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDate(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-time")]
Value::TimeTime(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-time")]
Value::TimeDateTime(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-time")]
Value::TimeDateTimeWithTimeZone(t) => {
args.add(t.as_deref());
let _ = args.add(t.as_deref());
}
#[cfg(feature = "with-uuid")]
Value::Uuid(uuid) => {
args.add(uuid.as_deref());
let _ = args.add(uuid.as_deref());
}
#[cfg(feature = "with-rust_decimal")]
Value::Decimal(d) => {
args.add(d.as_deref());
let _ = args.add(d.as_deref());
}
#[cfg(feature = "with-bigdecimal")]
Value::BigDecimal(d) => {
args.add(d.as_deref());
let _ = args.add(d.as_deref());
}
#[cfg(feature = "with-json")]
Value::Json(j) => {
args.add(j.as_deref());
let _ = args.add(j.as_deref());
}
#[cfg(feature = "postgres-array")]
Value::Array(_, _) => {
Expand Down
Loading

0 comments on commit ec2f9c4

Please sign in to comment.