Skip to content

Commit 9e92ad0

Browse files
committed
Fix wasm failing build due to getrandom in uuid library
1 parent a4da3d4 commit 9e92ad0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ serde_json = "1.0"
2020
time = { version = "0.3.7", features = ["serde-well-known", "formatting", "parsing"] }
2121
jsonwebtoken = { version = "8", default-features = false }
2222
yaup = "0.2.0"
23-
uuid = { version = "1.1.2", features = ["v4"] }
2423

2524
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
2625
futures = "0.3"
2726
isahc = { version = "1.0", features = ["http2", "text-decoding"], default_features = false }
27+
uuid = { version = "1.1.2", features = ["v4"] }
2828

2929
[target.'cfg(target_arch = "wasm32")'.dependencies]
3030
js-sys = "0.3.47"

src/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ impl Client {
810810
/// let client = client::Client::new(MEILISEARCH_HOST, token);
811811
/// # });
812812
/// ```
813+
#[cfg(not(target_arch = "wasm32"))]
813814
pub fn generate_tenant_token(
814815
&self,
815816
api_key_uid: String,

src/tenant_tokens.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use time::OffsetDateTime;
66
use uuid::Uuid;
77

88
#[derive(Debug, Serialize, Deserialize)]
9+
#[cfg(not(target_arch = "wasm32"))]
910
#[serde(rename_all = "camelCase")]
1011
struct TenantTokenClaim {
1112
api_key_uid: String,
@@ -14,6 +15,7 @@ struct TenantTokenClaim {
1415
exp: Option<OffsetDateTime>,
1516
}
1617

18+
#[cfg(not(target_arch = "wasm32"))]
1719
pub fn generate_tenant_token(
1820
api_key_uid: String,
1921
search_rules: Value,

0 commit comments

Comments
 (0)