WASM: Add try_clone implementations to Request and RequestBuilder (#1286)
				
					
				
			Currently the wasm client does not implement `try_clone` on `Request` or `RequestBuilder` like the blocking and async clients. This PR adds infallible `try_clone` implementations to the wasm client to improve the API parity. *Note*: Even though these APIs are infallible on wasm (no streaming bodies), I chose to keep the API identical.
This commit is contained in:
		| @@ -17,6 +17,7 @@ pub struct Body { | ||||
|     inner: Inner, | ||||
| } | ||||
|  | ||||
| #[derive(Clone)] | ||||
| enum Inner { | ||||
|     Bytes(Bytes), | ||||
|     #[cfg(feature = "multipart")] | ||||
| @@ -56,6 +57,12 @@ impl Body { | ||||
|             Inner::Multipart(form) => form.is_empty(), | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub(crate) fn clone(&self) -> Body { | ||||
|         Self { | ||||
|             inner: self.inner.clone(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<Bytes> for Body { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user