Skip to content

Commit 05d64fb

Browse files
authored
fix: agree one a single default runtime for the whole workspace (launchbadge#1988)
This fixes `cargo check --workspace` and rust-analyzer. Also see <launchbadge#1956>.
1 parent 29073cb commit 05d64fb

File tree

20 files changed

+51
-89
lines changed

20 files changed

+51
-89
lines changed

Cargo.lock

Lines changed: 11 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ authors = [
3636
]
3737

3838
[package.metadata.docs.rs]
39-
features = ["all", "runtime-async-std-native-tls"]
39+
features = ["all", "runtime-tokio-native-tls"]
4040
rustdoc-args = ["--cfg", "docsrs"]
4141

4242
[features]

examples/mysql/todos/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ workspace = "../../../"
66

77
[dependencies]
88
anyhow = "1.0"
9-
async-std = { version = "1.8.0", features = [ "attributes" ] }
109
futures = "0.3"
11-
paw = "1.0"
12-
sqlx = { path = "../../../", features = [ "mysql", "runtime-async-std-native-tls" ] }
13-
structopt = { version = "0.3", features = [ "paw" ] }
10+
sqlx = { path = "../../../", features = [ "mysql", "runtime-tokio-native-tls" ] }
11+
structopt = "0.3"
12+
tokio = { version = "1.20.0", features = ["macros"]}

examples/mysql/todos/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ enum Command {
1414
Done { id: u64 },
1515
}
1616

17-
#[async_std::main]
18-
#[paw::main]
19-
async fn main(args: Args) -> anyhow::Result<()> {
17+
#[tokio::main]
18+
async fn main() -> anyhow::Result<()> {
19+
let args = Args::from_args_safe()?;
2020
let pool = MySqlPool::connect(&env::var("DATABASE_URL")?).await?;
2121

2222
match args.cmd {

examples/postgres/files/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ edition = "2021"
77

88
[dependencies]
99
anyhow = "1.0"
10-
async-std = { version = "1.8.0", features = [ "attributes" ] }
11-
sqlx = { path = "../../../", features = ["postgres", "offline", "runtime-async-std-native-tls"] }
10+
sqlx = { path = "../../../", features = ["postgres", "offline", "runtime-tokio-native-tls"] }
11+
tokio = { version = "1.20.0", features = ["macros"]}
1212
dotenv = "0.15.0"

examples/postgres/files/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Display for PostWithAuthorQuery {
2626
}
2727
}
2828

29-
#[async_std::main]
29+
#[tokio::main]
3030
async fn main() -> anyhow::Result<()> {
3131
let pool = PgPool::connect(&dotenv::var("DATABASE_URL")?).await?;
3232

examples/postgres/json/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ workspace = "../../../"
66

77
[dependencies]
88
anyhow = "1.0"
9-
async-std = { version = "1.6.0", features = [ "attributes" ] }
109
dotenv = "0.15.0"
1110
futures = "0.3"
12-
paw = "1.0"
1311
serde = { version = "1", features = ["derive"] }
1412
serde_json = "1"
1513
sqlx = { path = "../../../", features = ["postgres", "json"] }
16-
structopt = { version = "0.3", features = ["paw"] }
14+
structopt = "0.3"
15+
tokio = { version = "1.20.0", features = ["macros"]}

examples/postgres/json/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ struct Row {
3030
person: Json<Person>,
3131
}
3232

33-
#[async_std::main]
34-
#[paw::main]
35-
async fn main(args: Args) -> anyhow::Result<()> {
33+
#[tokio::main]
34+
async fn main() -> anyhow::Result<()> {
35+
let args = Args::from_args_safe()?;
3636
let pool = PgPool::connect(&dotenv::var("DATABASE_URL")?).await?;
3737

3838
match args.cmd {

examples/postgres/listen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ edition = "2021"
55
workspace = "../../../"
66

77
[dependencies]
8-
async-std = { version = "1.8.0", features = [ "attributes", "unstable" ] }
98
sqlx = { path = "../../../", features = [ "postgres", "tls" ] }
109
futures = "0.3.1"
10+
tokio = { version = "1.20.0", features = ["macros"]}

examples/postgres/listen/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
use async_std::stream;
21
use futures::StreamExt;
32
use futures::TryStreamExt;
43
use sqlx::postgres::PgListener;
54
use sqlx::{Executor, PgPool};
65
use std::sync::atomic::{AtomicI64, Ordering};
76
use std::time::Duration;
87

9-
#[async_std::main]
8+
#[tokio::main]
109
async fn main() -> Result<(), Box<dyn std::error::Error>> {
1110
println!("Building PG pool.");
1211
let conn_str =

0 commit comments

Comments
 (0)