Fix compile error when target is wasm and multipart feature is enabled. (#1296)
This commit is contained in:
@@ -92,14 +92,18 @@ impl Request {
|
||||
|
||||
/// Attempts to clone the `Request`.
|
||||
///
|
||||
/// None is returned if a body is which can not be cloned. This method
|
||||
/// currently always returns `Some`, but that may change in the future.
|
||||
/// None is returned if a body is which can not be cloned.
|
||||
pub fn try_clone(&self) -> Option<Request> {
|
||||
let body = match self.body.as_ref() {
|
||||
Some(ref body) => Some(body.try_clone()?),
|
||||
None => None,
|
||||
};
|
||||
|
||||
Some(Self {
|
||||
method: self.method.clone(),
|
||||
url: self.url.clone(),
|
||||
headers: self.headers.clone(),
|
||||
body: self.body.as_ref().map(|body| body.clone()),
|
||||
body,
|
||||
cors: self.cors,
|
||||
credentials: self.credentials.clone(),
|
||||
})
|
||||
@@ -353,8 +357,7 @@ impl RequestBuilder {
|
||||
|
||||
/// Attempt to clone the RequestBuilder.
|
||||
///
|
||||
/// `None` is returned if the RequestBuilder can not be cloned. This method
|
||||
/// currently always returns `Some`, but that may change in the future.
|
||||
/// `None` is returned if the RequestBuilder can not be cloned.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user