Use doc_cfg to show feature requirements (#1134)
* Use `doc_cfg` to show feature requirements * Apply suggestions from code review
This commit is contained in:
@@ -472,6 +472,7 @@ impl RequestBuilder {
|
||||
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
|
||||
/// fail, or if `T` contains a map with non-string keys.
|
||||
#[cfg(feature = "json")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
|
||||
pub fn json<T: Serialize + ?Sized>(mut self, json: &T) -> RequestBuilder {
|
||||
let mut error = None;
|
||||
if let Ok(ref mut req) = self.request {
|
||||
@@ -510,6 +511,7 @@ impl RequestBuilder {
|
||||
///
|
||||
/// See [`multipart`](multipart/) for more examples.
|
||||
#[cfg(feature = "multipart")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "multipart")))]
|
||||
pub fn multipart(self, mut multipart: multipart::Form) -> RequestBuilder {
|
||||
let mut builder = self.header(
|
||||
CONTENT_TYPE,
|
||||
|
||||
Reference in New Issue
Block a user