Skip to content

Commit

Permalink
Trying to disable async-await feature of futures where it is possible
Browse files Browse the repository at this point in the history
  • Loading branch information
svartalf committed Feb 28, 2021
1 parent b8ce0de commit 2b7a911
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false

[dependencies]
heim = { path = "../heim", features = ["full"] }
futures = { version = "0.3", default-features = false, features = ["std"] }
futures = { version = "0.3", default-features = false, features = ["std", "async-await"] }
criterion = "~0.3"
smol = "~1.2"

Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cfg-if = "~1.0"
heim = { path = "../heim", features = ["full"] }
futures-timer = "~3.0"

futures = "~0.3"
futures = { version = "0.3", default-features = false, features = ["std"] }
smol = "~1.2"
tokio = { version = "~0.3", features = ["full"] }
async-std = { version = "~1.7", features = ["attributes"] }
Expand Down
1 change: 0 additions & 1 deletion heim-cpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ mach = "0.3.2"
[dev-dependencies]
heim-derive = { version = "0.1.0-rc.1", path = "../heim-derive" }
smol = "~1.2"
futures = "~0.3"
version-sync = "0.9"
futures-timer = "^3.0"

Expand Down
2 changes: 1 addition & 1 deletion heim-disk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ core-foundation = "~0.9"
[dev-dependencies]
heim-derive = { version = "0.1.0-rc.1", path = "../heim-derive" }
smol = "~1.2"
futures = "~0.3"
futures = { version = "~0.3", default-features = false, features = ["std"] }
version-sync = "0.9"

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion heim-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ libc = "~0.2"

[dev-dependencies]
heim-derive = { version = "0.1.0-rc.1", path = "../heim-derive" }
futures = "~0.3"
futures = { version = "~0.3", default-features = false, features = ["std"] }
smol = "~1.2"
version-sync = "0.9"

Expand Down
2 changes: 1 addition & 1 deletion heim-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ widestring = "0.4"
[dev-dependencies]
heim-derive = { version = "0.1.0-rc.1", path = "../heim-derive" }
smol = "~1.2"
futures = "~0.3"
futures = { version = "~0.3", default-features = false, features = ["std"] }
version-sync = "0.9"

[package.metadata.docs.rs]
Expand Down
1 change: 0 additions & 1 deletion heim-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ license = "Apache-2.0 OR MIT"

[dependencies]
futures = { version = "~0.3", default-features = false, features = ["std"] }
#futures-lite = "~1.11"
futures-timer = "~3.0"
once_cell = "~1.5"
smol = "~1.2"
Expand Down
2 changes: 1 addition & 1 deletion heim-virt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license = "Apache-2.0 OR MIT"
heim-common = { version = "0.1.0-rc.1", path = "../heim-common" }
heim-runtime = { version = "0.1.0-rc.1", path = "../heim-runtime" }
cfg-if = "~1.0"
futures = { version = "~0.3", default-features = false, features = ["std", "async-await"] }
futures = { version = "~0.3", default-features = false, features = ["std"] }

[target.'cfg(all(target_os = "linux", any(target_arch="x86", target_arch="x86_64")))'.dependencies]
raw-cpuid = "~8.1"
Expand Down
6 changes: 3 additions & 3 deletions heim-virt/src/sys/linux/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ where

async fn detect_openvz() -> Result<Virtualization, ()> {
// TODO: Can be done in a blocking task completely
let f1 = rt::fs::path_exists(rt::linux::procfs_root().join("vz"));
let f2 = rt::fs::path_exists(rt::linux::procfs_root().join("bc"));
let f1 = rt::fs::path_exists(rt::linux::procfs_root().join("vz")).await;
let f2 = rt::fs::path_exists(rt::linux::procfs_root().join("bc")).await;

match futures::join!(f1, f2) {
match (f1, f2) {
// `/proc/vz` exists in container and outside of the container,
// `/proc/bc` only outside of the container.
(true, false) => Ok(Virtualization::OpenVz),
Expand Down

0 comments on commit 2b7a911

Please sign in to comment.