Skip to content

Commit ba14ba4

Browse files
authored
Merge pull request #10 from pwoolcoc/allow-unsafe-in-wasm
Allow unsafe usage in the WASM backend
2 parents df81471 + 220266a commit ba14ba4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ $ cargo add http-client
5353

5454
## Safety
5555

56-
This crate uses ``#![deny(unsafe_code)]`` to ensure everything is implemented in
56+
For non-wasm clients, this crate uses ``#![deny(unsafe_code)]`` to ensure everything is implemented in
5757
100% Safe Rust.
5858

5959
## Contributing

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
//! The purpose of this crate is to provide a unified interface for multiple HTTP client backends,
55
//! so that they can be abstracted over without doing extra work.
66
7-
#![forbid(unsafe_code, future_incompatible, rust_2018_idioms)]
7+
#![forbid(future_incompatible, rust_2018_idioms)]
88
#![deny(missing_debug_implementations, nonstandard_style)]
99
#![warn(missing_docs, missing_doc_code_examples, unreachable_pub)]
1010
#![cfg_attr(feature = "docs", feature(doc_cfg))]
11+
// Forbid `unsafe` for the native & curl features, but allow it (for now) under the WASM backend
12+
#![cfg_attr(
13+
not(all(feature = "wasm_client", target_arch = "wasm32")),
14+
forbid(unsafe_code)
15+
)]
1116

1217
use futures::future::BoxFuture;
1318
use futures::io::{AsyncRead, Cursor};

0 commit comments

Comments
 (0)