Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow v3, v4, v5 features on wasm32-unknown-unknown #512

Merged
merged 1 commit into from Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Expand Up @@ -59,6 +59,7 @@ optional = true
version = "0.2.0"

[dependencies.md5]
default-features = false
optional = true
version = "0.7"

Expand All @@ -68,6 +69,7 @@ optional = true
version = "1.0.56"

[dependencies.sha1]
default-features = false
optional = true
version = "0.6"

Expand Down
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -46,14 +46,17 @@ various pieces of functionality:
* `serde` - adds the ability to serialize and deserialize a `Uuid` using the
`serde` crate.

You need to enable one of the following Cargo features together with
`v3`, `v4` or `v5` feature if you're targeting `wasm32-unknown-unknown` target:
You need to enable one of the following Cargo features together with the
`v4` feature if you're targeting `wasm32-unknown-unknown` target:

* `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via
`stdweb` combined with `cargo-web`
* `wasm-bindgen` - `wasm-bindgen` enables support for `OsRng` on
`wasm32-unknown-unknown` via [`wasm-bindgen`]

Alternatively, you can provide a custom `getrandom` implementation yourself
via [`getrandom::register_custom_getrandom`](https://docs.rs/getrandom/0.2.2/getrandom/macro.register_custom_getrandom.html).

By default, `uuid` can be depended on with:

```toml
Expand Down
36 changes: 3 additions & 33 deletions src/lib.rs
Expand Up @@ -156,41 +156,11 @@ mod serde_support;
mod slog_support;
#[cfg(test)]
mod test_util;
#[cfg(all(
feature = "v3",
any(
not(target_arch = "wasm32"),
target_os = "wasi",
all(
target_arch = "wasm32",
any(feature = "stdweb", feature = "wasm-bindgen")
)
)
))]
#[cfg(feature = "v3")]
mod v3;
#[cfg(all(
feature = "v4",
any(
not(target_arch = "wasm32"),
target_os = "wasi",
all(
target_arch = "wasm32",
any(feature = "stdweb", feature = "wasm-bindgen")
)
)
))]
#[cfg(feature = "v4")]
mod v4;
#[cfg(all(
feature = "v5",
any(
not(target_arch = "wasm32"),
target_os = "wasi",
all(
target_arch = "wasm32",
any(feature = "stdweb", feature = "wasm-bindgen")
)
)
))]
#[cfg(feature = "v5")]
mod v5;
#[cfg(all(windows, feature = "winapi"))]
mod winapi_support;
Expand Down