diff --git a/scylla-cql/src/frame/response/cql_to_rust.rs b/scylla-cql/src/frame/response/cql_to_rust.rs index 50ba7a9386..ec66d1e98e 100644 --- a/scylla-cql/src/frame/response/cql_to_rust.rs +++ b/scylla-cql/src/frame/response/cql_to_rust.rs @@ -557,7 +557,7 @@ mod tests { .unwrap() .and_hms_opt(2, 0, 0) .unwrap(); - let datetime_utc = DateTime::::from_utc(naivedatetime_utc, Utc); + let datetime_utc = DateTime::::from_naive_utc_and_offset(naivedatetime_utc, Utc); assert_eq!( datetime_utc, diff --git a/scylla-cql/src/frame/types.rs b/scylla-cql/src/frame/types.rs index 71b0f78205..fd2254c8b0 100644 --- a/scylla-cql/src/frame/types.rs +++ b/scylla-cql/src/frame/types.rs @@ -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); @@ -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); @@ -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); diff --git a/scylla-cql/src/frame/value_tests.rs b/scylla-cql/src/frame/value_tests.rs index f7e480362f..bd411f45a8 100644 --- a/scylla-cql/src/frame/value_tests.rs +++ b/scylla-cql/src/frame/value_tests.rs @@ -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::::from_utc(native_datetime, Utc); + let test_datetime = DateTime::::from_naive_utc_and_offset(native_datetime, Utc); let bytes: Vec = serialized(test_datetime); let mut expected_bytes: Vec = vec![0, 0, 0, 8]; diff --git a/scylla/src/history.rs b/scylla/src/history.rs index 6b1bd1a98f..34c2c19244 100644 --- a/scylla/src/history.rs +++ b/scylla/src/history.rs @@ -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::::from_utc( + let the_time: TimePoint = DateTime::::from_naive_utc_and_offset( NaiveDateTime::new( NaiveDate::from_ymd_opt(2022, 2, 22).unwrap(), NaiveTime::from_hms_opt(20, 22, 22).unwrap(), diff --git a/scylla/src/transport/session_test.rs b/scylla/src/transport/session_test.rs index 6bc9f0e4f1..805217053d 100644 --- a/scylla/src/transport/session_test.rs +++ b/scylla/src/transport/session_test.rs @@ -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(