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:
@@ -264,6 +264,7 @@ impl RequestBuilder {
|
||||
/// # }
|
||||
/// ```
|
||||
#[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,
|
||||
@@ -353,6 +354,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 {
|
||||
|
||||
Reference in New Issue
Block a user