From 097cb99ae556097aed9fd9571dc89bd423b277bb Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 29 Apr 2022 11:27:30 +0200 Subject: [PATCH] chore: Make target-specific dependency formatting more consistent * Put target-specific dependencies last * Put cfg(wasm) before cfg(not(wasm)) * Use long table names only where lines get too long otherwise --- crates/matrix-sdk-common/Cargo.toml | 9 ++++----- crates/matrix-sdk-crypto/Cargo.toml | 17 +++++++---------- crates/matrix-sdk/Cargo.toml | 20 ++++++-------------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/crates/matrix-sdk-common/Cargo.toml b/crates/matrix-sdk-common/Cargo.toml index 9a5f75cb7..70a1b70b3 100644 --- a/crates/matrix-sdk-common/Cargo.toml +++ b/crates/matrix-sdk-common/Cargo.toml @@ -20,13 +20,12 @@ async-trait = "0.1.53" ruma = { version = "0.6.0", features = ["client-api-c"] } serde = "1.0.136" -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tokio = { version = "1.17.0", default-features = false, features = ["rt", "sync"] } -instant = { version = "0.1.12", features = ["now"] } - - [target.'cfg(target_arch = "wasm32")'.dependencies] async-lock = "2.5.0" instant = { version = "0.1.12", features = ["wasm-bindgen", "inaccurate"] } futures-util = { version = "0.3.21", default-features = false, features = ["channel"] } wasm-bindgen-futures = "0.4.30" + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +tokio = { version = "1.17.0", default-features = false, features = ["rt", "sync"] } +instant = { version = "0.1.12", features = ["now"] } diff --git a/crates/matrix-sdk-crypto/Cargo.toml b/crates/matrix-sdk-crypto/Cargo.toml index 942e602ff..5030fb250 100644 --- a/crates/matrix-sdk-crypto/Cargo.toml +++ b/crates/matrix-sdk-crypto/Cargo.toml @@ -51,22 +51,18 @@ anyhow = "1.0.57" # feature = testing only http = { version = "0.2.6", optional = true } -[target.'cfg(not(target_arch = "wasm32"))'.dependencies.vodozemac] -git = "https://github.com/matrix-org/vodozemac" -rev = "e09c93f2c8df9770793abeec57ed984d5e1f3834" - -[target.'cfg(target_arch = "wasm32")'.dev-dependencies.getrandom] -version = "0.2.6" -features = ["js"] +[dependencies.ruma] +version = "0.6.0" +features = ["client-api-c", "rand", "unstable-msc2676", "unstable-msc2677"] [target.'cfg(target_arch = "wasm32")'.dependencies.vodozemac] git = "https://github.com/matrix-org/vodozemac" rev = "e09c93f2c8df9770793abeec57ed984d5e1f3834" features = ["js"] -[dependencies.ruma] -version = "0.6.0" -features = ["client-api-c", "rand", "unstable-msc2676", "unstable-msc2677"] +[target.'cfg(not(target_arch = "wasm32"))'.dependencies.vodozemac] +git = "https://github.com/matrix-org/vodozemac" +rev = "e09c93f2c8df9770793abeec57ed984d5e1f3834" [dev-dependencies] futures = { version = "0.3.21", default-features = false, features = ["executor"] } @@ -79,4 +75,5 @@ proptest = { version = "1.0.0", default-features = false, features = ["std"] } tokio = { version = "1.7.0", default-features = false, features = ["macros", "rt-multi-thread"] } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] +getrandom = { version = "0.2.6", features = ["js"] } wasm-bindgen-test = "0.3.24" diff --git a/crates/matrix-sdk/Cargo.toml b/crates/matrix-sdk/Cargo.toml index d6531b1ab..25ef8395b 100644 --- a/crates/matrix-sdk/Cargo.toml +++ b/crates/matrix-sdk/Cargo.toml @@ -118,14 +118,9 @@ optional = true [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-timer= "0.2.5" -[target.'cfg(not(target_arch = "wasm32"))'.dependencies.backoff] -version = "0.4.0" -features = ["tokio"] - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio] -version = "1.17.0" -default-features = false -features = ["fs", "rt"] +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +backoff = { version = "0.4.0", features = ["tokio"] } +tokio = { version = "1.17.0", default-features = false, features = ["fs", "rt"] } [dev-dependencies] anyhow = "1.0.57" @@ -139,16 +134,13 @@ serde_json = "1.0.79" tempfile = "3.3.0" tracing-subscriber = { version = "0.3.11", features = ["env-filter"] } - -[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.tokio] -version = "1.17.0" -default-features = false -features = ["rt-multi-thread", "macros"] - [target.'cfg(target_arch = "wasm32")'.dev-dependencies] getrandom = { version = "0.2.6", default-features = false, features = ["js"] } wasm-bindgen-test = "0.3.30" +[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] +tokio = { version = "1.17.0", default-features = false, features = ["rt-multi-thread", "macros"] } + [[example]] name = "cross_signing_bootstrap" required-features = ["encryption"]