Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: appease clippy and the deprecation warnings #805

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scylla-cql/src/frame/response/cql_to_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ mod tests {
.unwrap()
.and_hms_opt(2, 0, 0)
.unwrap();
let datetime_utc = DateTime::<Utc>::from_utc(naivedatetime_utc, Utc);
let datetime_utc = DateTime::<Utc>::from_naive_utc_and_offset(naivedatetime_utc, Utc);

assert_eq!(
datetime_utc,
Expand Down
6 changes: 3 additions & 3 deletions scylla-cql/src/frame/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn write_int_length(v: usize, buf: &mut impl BufMut) -> Result<(), ParseError> {

#[test]
fn type_int() {
let vals = vec![i32::MIN, -1, 0, 1, i32::MAX];
let vals = [i32::MIN, -1, 0, 1, i32::MAX];
for val in vals.iter() {
let mut buf = Vec::new();
write_int(*val, &mut buf);
Expand All @@ -161,7 +161,7 @@ pub fn write_long(v: i64, buf: &mut impl BufMut) {

#[test]
fn type_long() {
let vals = vec![i64::MIN, -1, 0, 1, i64::MAX];
let vals = [i64::MIN, -1, 0, 1, i64::MAX];
for val in vals.iter() {
let mut buf = Vec::new();
write_long(*val, &mut buf);
Expand Down Expand Up @@ -192,7 +192,7 @@ fn write_short_length(v: usize, buf: &mut impl BufMut) -> Result<(), ParseError>

#[test]
fn type_short() {
let vals = vec![i16::MIN, -1, 0, 1, i16::MAX];
let vals = [i16::MIN, -1, 0, 1, i16::MAX];
for val in vals.iter() {
let mut buf = Vec::new();
write_short(*val, &mut buf);
Expand Down
2 changes: 1 addition & 1 deletion scylla-cql/src/frame/value_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn datetime_serialization() {
((*test_val % 1000) as i32 * 1_000_000) as u32,
)
.expect("invalid or out-of-range datetime");
let test_datetime = DateTime::<Utc>::from_utc(native_datetime, Utc);
let test_datetime = DateTime::<Utc>::from_naive_utc_and_offset(native_datetime, Utc);
let bytes: Vec<u8> = serialized(test_datetime);

let mut expected_bytes: Vec<u8> = vec![0, 0, 0, 8];
Expand Down
2 changes: 1 addition & 1 deletion scylla/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ mod tests {
// HistoryCollector sets the timestamp to current time which changes with each test.
// Setting it to one makes it possible to test displaying consistently.
fn set_one_time(mut history: StructuredHistory) -> StructuredHistory {
let the_time: TimePoint = DateTime::<Utc>::from_utc(
let the_time: TimePoint = DateTime::<Utc>::from_naive_utc_and_offset(
NaiveDateTime::new(
NaiveDate::from_ymd_opt(2022, 2, 22).unwrap(),
NaiveTime::from_hms_opt(20, 22, 22).unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion scylla/src/transport/session_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ async fn test_use_keyspace() {
)))
));

let long_name: String = vec!['a'; 49].iter().collect();
let long_name: String = ['a'; 49].iter().collect();
assert!(matches!(
session.use_keyspace(long_name, false).await,
Err(QueryError::BadQuery(BadQuery::BadKeyspaceName(
Expand Down