diff --git a/Cargo.toml b/Cargo.toml index 35b2cb4fe6..d983e6de42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ readme = "README.md" repository = "https://github.com/launchbadge/sqlx" documentation = "https://docs.rs/sqlx" description = "🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite." -edition = "2018" +edition = "2021" keywords = ["database", "async", "postgres", "mysql", "sqlite"] categories = ["database", "asynchronous"] authors = [ diff --git a/examples/mysql/todos/Cargo.toml b/examples/mysql/todos/Cargo.toml index af41b550b3..2bd8c5f01c 100644 --- a/examples/mysql/todos/Cargo.toml +++ b/examples/mysql/todos/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-example-mysql-todos" version = "0.1.0" -edition = "2018" +edition = "2021" workspace = "../../../" [dependencies] diff --git a/examples/postgres/json/Cargo.toml b/examples/postgres/json/Cargo.toml index 07c0e3b96f..b1c605557c 100644 --- a/examples/postgres/json/Cargo.toml +++ b/examples/postgres/json/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "json" version = "0.1.0" -edition = "2018" +edition = "2021" workspace = "../../../" [dependencies] diff --git a/examples/postgres/listen/Cargo.toml b/examples/postgres/listen/Cargo.toml index 95c3d7dd0d..3688dbe94c 100644 --- a/examples/postgres/listen/Cargo.toml +++ b/examples/postgres/listen/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-example-postgres-listen" version = "0.1.0" -edition = "2018" +edition = "2021" workspace = "../../../" [dependencies] diff --git a/examples/postgres/mockable-todos/Cargo.toml b/examples/postgres/mockable-todos/Cargo.toml index b8f41c2ea4..0e5194cc17 100644 --- a/examples/postgres/mockable-todos/Cargo.toml +++ b/examples/postgres/mockable-todos/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-example-postgres-mockable-todos" version = "0.1.0" -edition = "2018" +edition = "2021" workspace = "../../../" [dependencies] diff --git a/examples/postgres/transaction/Cargo.toml b/examples/postgres/transaction/Cargo.toml index a51d4d37f8..da29536afe 100644 --- a/examples/postgres/transaction/Cargo.toml +++ b/examples/postgres/transaction/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-example-postgres-transaction" version = "0.1.0" -edition = "2018" +edition = "2021" workspace = "../../../" [dependencies] diff --git a/sqlx-bench/Cargo.toml b/sqlx-bench/Cargo.toml index 0b288ca892..8f7b8495ba 100644 --- a/sqlx-bench/Cargo.toml +++ b/sqlx-bench/Cargo.toml @@ -2,7 +2,7 @@ name = "sqlx-bench" version = "0.1.0" authors = ["Austin Bonander "] -edition = "2018" +edition = "2021" publish = false [features] diff --git a/sqlx-cli/Cargo.toml b/sqlx-cli/Cargo.toml index b1bda24ec7..9ee835471d 100644 --- a/sqlx-cli/Cargo.toml +++ b/sqlx-cli/Cargo.toml @@ -2,7 +2,7 @@ name = "sqlx-cli" version = "0.5.12" description = "Command-line utility for SQLx, the Rust SQL toolkit." -edition = "2018" +edition = "2021" readme = "README.md" homepage = "https://github.com/launchbadge/sqlx" repository = "https://github.com/launchbadge/sqlx" diff --git a/sqlx-core/Cargo.toml b/sqlx-core/Cargo.toml index 77e49c6ff7..4c6138ad55 100644 --- a/sqlx-core/Cargo.toml +++ b/sqlx-core/Cargo.toml @@ -4,7 +4,7 @@ version = "0.5.12" repository = "https://github.com/launchbadge/sqlx" description = "Core of SQLx, the rust SQL toolkit. Not intended to be used directly." license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" authors = [ "Ryan Leckey ", "Austin Bonander ", @@ -67,27 +67,41 @@ json = ["serde", "serde_json"] # runtimes runtime-actix-native-tls = [ "sqlx-rt/runtime-actix-native-tls", + "sqlx/runtime-actix-native-tls", "_tls-native-tls", "_rt-actix", ] runtime-async-std-native-tls = [ "sqlx-rt/runtime-async-std-native-tls", + "sqlx/runtime-async-std-native-tls", "_tls-native-tls", "_rt-async-std", ] runtime-tokio-native-tls = [ "sqlx-rt/runtime-tokio-native-tls", + "sqlx/runtime-tokio-native-tls", "_tls-native-tls", "_rt-tokio", ] -runtime-actix-rustls = ["sqlx-rt/runtime-actix-rustls", "_tls-rustls", "_rt-actix"] +runtime-actix-rustls = [ + "sqlx-rt/runtime-actix-rustls", + "sqlx/runtime-actix-rustls", + "_tls-rustls", + "_rt-actix" +] runtime-async-std-rustls = [ "sqlx-rt/runtime-async-std-rustls", + "sqlx/runtime-async-std-rustls", "_tls-rustls", "_rt-async-std", ] -runtime-tokio-rustls = ["sqlx-rt/runtime-tokio-rustls", "_tls-rustls", "_rt-tokio"] +runtime-tokio-rustls = [ + "sqlx-rt/runtime-tokio-rustls", + "sqlx/runtime-tokio-rustls", + "_tls-rustls", + "_rt-tokio" +] # for conditional compilation _rt-actix = ["tokio-stream"] @@ -103,7 +117,7 @@ offline = ["serde", "either/serde"] paste = "1.0.6" ahash = "0.7.6" atoi = "0.4.0" -sqlx-rt = { path = "../sqlx-rt", version = "0.5.12"} +sqlx-rt = { path = "../sqlx-rt", version = "0.5.12" } base64 = { version = "0.13.0", default-features = false, optional = true, features = ["std"] } bigdecimal_ = { version = "0.3.0", optional = true, package = "bigdecimal" } rust_decimal = { version = "1.19.0", optional = true } diff --git a/sqlx-core/src/any/options.rs b/sqlx-core/src/any/options.rs index fa1beb33f5..f832df98e3 100644 --- a/sqlx-core/src/any/options.rs +++ b/sqlx-core/src/any/options.rs @@ -3,7 +3,6 @@ use crate::connection::ConnectOptions; use crate::error::Error; use futures_core::future::BoxFuture; use log::LevelFilter; -use std::convert::TryFrom; use std::str::FromStr; use std::time::Duration; diff --git a/sqlx-core/src/mysql/types/chrono.rs b/sqlx-core/src/mysql/types/chrono.rs index 76e8b2985d..254d66987e 100644 --- a/sqlx-core/src/mysql/types/chrono.rs +++ b/sqlx-core/src/mysql/types/chrono.rs @@ -1,5 +1,3 @@ -use std::convert::TryFrom; - use bytes::Buf; use chrono::{DateTime, Datelike, Local, NaiveDate, NaiveDateTime, NaiveTime, Timelike, Utc}; diff --git a/sqlx-core/src/mysql/types/int.rs b/sqlx-core/src/mysql/types/int.rs index feff8626f3..f1ef3bc458 100644 --- a/sqlx-core/src/mysql/types/int.rs +++ b/sqlx-core/src/mysql/types/int.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use byteorder::{ByteOrder, LittleEndian}; use crate::decode::Decode; diff --git a/sqlx-core/src/mysql/types/time.rs b/sqlx-core/src/mysql/types/time.rs index fc600257f5..638e68fcac 100644 --- a/sqlx-core/src/mysql/types/time.rs +++ b/sqlx-core/src/mysql/types/time.rs @@ -1,5 +1,3 @@ -use std::convert::TryFrom; - use byteorder::{ByteOrder, LittleEndian}; use bytes::Buf; use time::macros::format_description; diff --git a/sqlx-core/src/mysql/types/uint.rs b/sqlx-core/src/mysql/types/uint.rs index 1d7212a144..b66baca450 100644 --- a/sqlx-core/src/mysql/types/uint.rs +++ b/sqlx-core/src/mysql/types/uint.rs @@ -5,7 +5,6 @@ use crate::mysql::protocol::text::{ColumnFlags, ColumnType}; use crate::mysql::{MySql, MySqlTypeInfo, MySqlValueFormat, MySqlValueRef}; use crate::types::Type; use byteorder::{ByteOrder, LittleEndian}; -use std::convert::TryInto; fn uint_type_info(ty: ColumnType) -> MySqlTypeInfo { MySqlTypeInfo { diff --git a/sqlx-core/src/net/tls/mod.rs b/sqlx-core/src/net/tls/mod.rs index 6e57b82400..7239cc392e 100644 --- a/sqlx-core/src/net/tls/mod.rs +++ b/sqlx-core/src/net/tls/mod.rs @@ -1,6 +1,5 @@ #![allow(dead_code)] -use std::convert::TryFrom; use std::io; use std::ops::{Deref, DerefMut}; use std::path::PathBuf; diff --git a/sqlx-core/src/postgres/connection/describe.rs b/sqlx-core/src/postgres/connection/describe.rs index a5e2a714db..0ff771a67c 100644 --- a/sqlx-core/src/postgres/connection/describe.rs +++ b/sqlx-core/src/postgres/connection/describe.rs @@ -10,7 +10,6 @@ use crate::query_scalar::{query_scalar, query_scalar_with}; use crate::types::Json; use crate::HashMap; use futures_core::future::BoxFuture; -use std::convert::TryFrom; use std::fmt::Write; use std::sync::Arc; diff --git a/sqlx-core/src/postgres/copy.rs b/sqlx-core/src/postgres/copy.rs index babdecca47..ebb44a5f52 100644 --- a/sqlx-core/src/postgres/copy.rs +++ b/sqlx-core/src/postgres/copy.rs @@ -10,7 +10,6 @@ use bytes::{BufMut, Bytes}; use futures_core::stream::BoxStream; use smallvec::alloc::borrow::Cow; use sqlx_rt::{AsyncRead, AsyncReadExt, AsyncWriteExt}; -use std::convert::TryFrom; use std::ops::{Deref, DerefMut}; impl PgConnection { diff --git a/sqlx-core/src/postgres/message/response.rs b/sqlx-core/src/postgres/message/response.rs index 767dd76732..eb5d5b1bce 100644 --- a/sqlx-core/src/postgres/message/response.rs +++ b/sqlx-core/src/postgres/message/response.rs @@ -26,7 +26,7 @@ impl PgSeverity { } } -impl std::convert::TryFrom<&str> for PgSeverity { +impl TryFrom<&str> for PgSeverity { type Error = Error; fn try_from(s: &str) -> Result { @@ -131,7 +131,6 @@ impl Decode<'_> for Notice { break; } - use std::convert::TryInto; match field { b'S' => { // Discard potential errors, because the message might be localized diff --git a/sqlx-core/src/postgres/types/bigdecimal.rs b/sqlx-core/src/postgres/types/bigdecimal.rs index f7958bab17..709909d6cb 100644 --- a/sqlx-core/src/postgres/types/bigdecimal.rs +++ b/sqlx-core/src/postgres/types/bigdecimal.rs @@ -1,5 +1,4 @@ use std::cmp; -use std::convert::{TryFrom, TryInto}; use bigdecimal::BigDecimal; use num_bigint::{BigInt, Sign}; diff --git a/sqlx-core/src/postgres/types/decimal.rs b/sqlx-core/src/postgres/types/decimal.rs index 8502a636cc..2fd7bff861 100644 --- a/sqlx-core/src/postgres/types/decimal.rs +++ b/sqlx-core/src/postgres/types/decimal.rs @@ -3,7 +3,6 @@ use rust_decimal::{ prelude::{ToPrimitive, Zero}, Decimal, }; -use std::convert::{TryFrom, TryInto}; use crate::decode::Decode; use crate::encode::{Encode, IsNull}; diff --git a/sqlx-core/src/postgres/types/interval.rs b/sqlx-core/src/postgres/types/interval.rs index 05f8089f0b..39719cab0d 100644 --- a/sqlx-core/src/postgres/types/interval.rs +++ b/sqlx-core/src/postgres/types/interval.rs @@ -1,4 +1,3 @@ -use std::convert::{TryFrom, TryInto}; use std::mem; use byteorder::{NetworkEndian, ReadBytesExt}; diff --git a/sqlx-core/src/postgres/types/mac_address.rs b/sqlx-core/src/postgres/types/mac_address.rs index 33f4132681..f12e9f8324 100644 --- a/sqlx-core/src/postgres/types/mac_address.rs +++ b/sqlx-core/src/postgres/types/mac_address.rs @@ -1,7 +1,5 @@ use mac_address::MacAddress; -use std::convert::TryInto; - use crate::decode::Decode; use crate::encode::{Encode, IsNull}; use crate::error::BoxDynError; diff --git a/sqlx-core/src/postgres/types/money.rs b/sqlx-core/src/postgres/types/money.rs index 1deacd74c7..73448ba373 100644 --- a/sqlx-core/src/postgres/types/money.rs +++ b/sqlx-core/src/postgres/types/money.rs @@ -96,8 +96,6 @@ impl PgMoney { /// [`Decimal`]: crate::types::Decimal #[cfg(feature = "decimal")] pub fn from_decimal(mut decimal: rust_decimal::Decimal, locale_frac_digits: u32) -> Self { - use std::convert::TryFrom; - // this is all we need to convert to our expected locale's `frac_digits` decimal.rescale(locale_frac_digits); diff --git a/sqlx-core/src/postgres/types/numeric.rs b/sqlx-core/src/postgres/types/numeric.rs index eb40262cb6..a83a771fda 100644 --- a/sqlx-core/src/postgres/types/numeric.rs +++ b/sqlx-core/src/postgres/types/numeric.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use bytes::Buf; use crate::error::BoxDynError; diff --git a/sqlx-core/src/sqlite/connection/establish.rs b/sqlx-core/src/sqlite/connection/establish.rs index ccd913fa8c..ae093fada5 100644 --- a/sqlx-core/src/sqlite/connection/establish.rs +++ b/sqlx-core/src/sqlite/connection/establish.rs @@ -10,12 +10,9 @@ use libsqlite3_sys::{ }; use std::ffi::CString; use std::io; +use std::ptr::{null, null_mut}; use std::sync::atomic::{AtomicU64, Ordering}; use std::time::Duration; -use std::{ - convert::TryFrom, - ptr::{null, null_mut}, -}; static THREAD_ID: AtomicU64 = AtomicU64::new(0); diff --git a/sqlx-core/src/sqlite/types/int.rs b/sqlx-core/src/sqlite/types/int.rs index 1fd13c46f5..96a6e202ec 100644 --- a/sqlx-core/src/sqlite/types/int.rs +++ b/sqlx-core/src/sqlite/types/int.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::decode::Decode; use crate::encode::{Encode, IsNull}; use crate::error::BoxDynError; diff --git a/sqlx-core/src/sqlite/types/uint.rs b/sqlx-core/src/sqlite/types/uint.rs index df395f010b..fed16cc21f 100644 --- a/sqlx-core/src/sqlite/types/uint.rs +++ b/sqlx-core/src/sqlite/types/uint.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::decode::Decode; use crate::encode::{Encode, IsNull}; use crate::error::BoxDynError; diff --git a/sqlx-macros/Cargo.toml b/sqlx-macros/Cargo.toml index f13b9370cb..bac78e5fd8 100644 --- a/sqlx-macros/Cargo.toml +++ b/sqlx-macros/Cargo.toml @@ -4,7 +4,7 @@ version = "0.5.12" repository = "https://github.com/launchbadge/sqlx" description = "Macros for SQLx, the rust SQL toolkit. Not intended to be used directly." license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" authors = [ "Ryan Leckey ", "Austin Bonander ", diff --git a/sqlx-rt/Cargo.toml b/sqlx-rt/Cargo.toml index 46cb9385de..f87df6adad 100644 --- a/sqlx-rt/Cargo.toml +++ b/sqlx-rt/Cargo.toml @@ -4,7 +4,7 @@ version = "0.5.12" repository = "https://github.com/launchbadge/sqlx" license = "MIT OR Apache-2.0" description = "Runtime abstraction used by SQLx, the Rust SQL toolkit. Not intended to be used directly." -edition = "2018" +edition = "2021" authors = [ "Ryan Leckey ", "Austin Bonander ", diff --git a/sqlx-test/Cargo.toml b/sqlx-test/Cargo.toml index 60f299c1fe..1d1ac558a4 100644 --- a/sqlx-test/Cargo.toml +++ b/sqlx-test/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-test" version = "0.1.0" -edition = "2018" +edition = "2021" publish = false [dependencies]