Implement Default for Client and ClientBuilder on the wasm32 target (#813)

This commit is contained in:
Paolo Barbolini
2020-02-20 17:44:19 +01:00
committed by GitHub
parent 5a2cf97872
commit 7214e123c4

View File

@@ -101,6 +101,12 @@ impl Client {
}
}
impl Default for Client {
fn default() -> Self {
Self::new()
}
}
async fn fetch(req: Request) -> crate::Result<Response> {
// Build the js Request
let mut init = web_sys::RequestInit::new();
@@ -182,3 +188,9 @@ impl ClientBuilder {
Ok(Client(()))
}
}
impl Default for ClientBuilder {
fn default() -> Self {
Self::new()
}
}