Skip to content

Commit

Permalink
Support more targets
Browse files Browse the repository at this point in the history
With the release of rustls v0.21.8, a lot more architectures are
supported now.
  • Loading branch information
CryZe committed Oct 24, 2023
1 parent 4fcce82 commit 43d25ec
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 23 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ snafu = { version = "0.7.1", default-features = false, features = ["std"] }
url = "2.1.0"
uuid = { version = "1.1.2", default-features = false, features = ["serde"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
[target.'cfg(not(target_family = "wasm"))'.dependencies]
hyper = { version = "0.14.1", default-features = false, features = ["tcp", "client", "http2"] }

[target.'cfg(all(any(target_os = "linux", target_family = "windows", target_os = "macos"), any(target_arch = "x86", target_arch = "x86_64", target_arch = "arm", target_arch = "aarch64")))'.dependencies]
hyper-rustls = { version = "0.23.0", default-features = false, features = ["native-tokio", "http2", "tls12"] }
[target.'cfg(all(any(target_os = "linux", target_family = "windows", target_os = "macos"), any(target_arch = "arm", target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64", target_arch = "loongarch64", all(target_arch = "mips", target_endian = "little"), all(target_arch = "mips64", target_endian = "little"), all(target_arch = "powerpc", target_endian = "big"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "s390x")))'.dependencies]
hyper-rustls = { version = "0.24.1", default-features = false, features = ["native-tokio", "http2", "tls12"] }

[target.'cfg(all(not(target_arch = "wasm32"), not(all(any(target_os = "linux", target_family = "windows", target_os = "macos"), any(target_arch = "x86", target_arch = "x86_64", target_arch = "arm", target_arch = "aarch64")))))'.dependencies]
[target.'cfg(all(not(target_family = "wasm"), not(all(any(target_os = "linux", target_family = "windows", target_os = "macos"), any(target_arch = "arm", target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64", target_arch = "loongarch64", all(target_arch = "mips", target_endian = "little"), all(target_arch = "mips64", target_endian = "little"), all(target_arch = "powerpc", target_endian = "big"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "s390x")))))'.dependencies]
hyper-tls = "0.5.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
[target.'cfg(target_family = "wasm")'.dependencies]
js-sys = "0.3.31"
wasm-bindgen = "0.2.51"
wasm-bindgen-futures = "0.4.4"
Expand Down
8 changes: 4 additions & 4 deletions src/platform/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
mod native;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
pub use self::native::*;

#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
mod wasm;
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
pub use self::wasm::*;
44 changes: 36 additions & 8 deletions src/platform/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@ use hyper::body::Buf;
#[cfg(all(
any(target_os = "linux", target_family = "windows", target_os = "macos"),
any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "x86",
target_arch = "x86_64",
target_arch = "loongarch64",
all(target_arch = "mips", target_endian = "little"),
all(target_arch = "mips64", target_endian = "little"),
all(target_arch = "powerpc", target_endian = "big"),
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "s390x",
),
))]
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
#[cfg(not(all(
any(target_os = "linux", target_family = "windows", target_os = "macos"),
any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "x86",
target_arch = "x86_64",
target_arch = "loongarch64",
all(target_arch = "mips", target_endian = "little"),
all(target_arch = "mips64", target_endian = "little"),
all(target_arch = "powerpc", target_endian = "big"),
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "s390x",
),
)))]
use hyper_tls::HttpsConnector;
Expand All @@ -42,10 +56,17 @@ impl Client {
#[cfg(all(
any(target_os = "linux", target_family = "windows", target_os = "macos"),
any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "x86",
target_arch = "x86_64",
target_arch = "loongarch64",
all(target_arch = "mips", target_endian = "little"),
all(target_arch = "mips64", target_endian = "little"),
all(target_arch = "powerpc", target_endian = "big"),
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "s390x",
),
))]
let https = HttpsConnectorBuilder::new()
Expand All @@ -56,10 +77,17 @@ impl Client {
#[cfg(not(all(
any(target_os = "linux", target_family = "windows", target_os = "macos"),
any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "x86",
target_arch = "x86_64",
target_arch = "loongarch64",
all(target_arch = "mips", target_endian = "little"),
all(target_arch = "mips64", target_endian = "little"),
all(target_arch = "powerpc", target_endian = "big"),
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "s390x",
),
)))]
let https = HttpsConnector::new();
Expand Down
8 changes: 2 additions & 6 deletions src/race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ pub struct Settings<'a> {
}

/// The type of update to perform on the given property.
#[derive(Default)]
pub enum Update<T> {
/// Keep the previous value of the property.
#[default]
Keep,
/// Clear the value of the property.
Clear,
Expand All @@ -191,12 +193,6 @@ impl<T> Update<T> {
}
}

impl<T> Default for Update<T> {
fn default() -> Self {
Update::Keep
}
}

impl<T: serde::Serialize> serde::Serialize for Update<T> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down

0 comments on commit 43d25ec

Please sign in to comment.