From 709475b2bbd72b01bba7cd23412e601dd0351df1 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 29 Mar 2019 11:59:38 -0700 Subject: [PATCH] multipart::Field renamed to MultipartField --- CHANGES.md | 6 ++++++ src/types/mod.rs | 2 +- src/types/multipart.rs | 21 +++++++++------------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 13eeb67d7..47b0f9875 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [1.0.0-alpha.2] - 2019-03-29 + +### Changed + +* multipart::Field renamed to MultipartField + ## [1.0.0-alpha.1] - 2019-03-28 ### Changed diff --git a/src/types/mod.rs b/src/types/mod.rs index c9aed94f9..9a0a08801 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -10,7 +10,7 @@ pub(crate) mod readlines; pub use self::form::{Form, FormConfig}; pub use self::json::{Json, JsonConfig}; -pub use self::multipart::{Multipart, MultipartItem}; +pub use self::multipart::{Multipart, MultipartField, MultipartItem}; pub use self::path::Path; pub use self::payload::{Payload, PayloadConfig}; pub use self::query::Query; diff --git a/src/types/multipart.rs b/src/types/multipart.rs index 50ef38135..65a64d5e1 100644 --- a/src/types/multipart.rs +++ b/src/types/multipart.rs @@ -39,7 +39,7 @@ pub struct Multipart { /// Multipart item pub enum MultipartItem { /// Multipart field - Field(Field), + Field(MultipartField), /// Nested multipart stream Nested(Multipart), } @@ -402,12 +402,9 @@ impl InnerMultipart { )?)); self.item = InnerMultipartItem::Field(Rc::clone(&field)); - Ok(Async::Ready(Some(MultipartItem::Field(Field::new( - safety.clone(), - headers, - mt, - field, - ))))) + Ok(Async::Ready(Some(MultipartItem::Field( + MultipartField::new(safety.clone(), headers, mt, field), + )))) } } } @@ -421,21 +418,21 @@ impl Drop for InnerMultipart { } /// A single field in a multipart stream -pub struct Field { +pub struct MultipartField { ct: mime::Mime, headers: HeaderMap, inner: Rc>, safety: Safety, } -impl Field { +impl MultipartField { fn new( safety: Safety, headers: HeaderMap, ct: mime::Mime, inner: Rc>, ) -> Self { - Field { + MultipartField { ct, headers, inner, @@ -466,7 +463,7 @@ impl Field { } } -impl Stream for Field { +impl Stream for MultipartField { type Item = Bytes; type Error = MultipartError; @@ -479,7 +476,7 @@ impl Stream for Field { } } -impl fmt::Debug for Field { +impl fmt::Debug for MultipartField { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { writeln!(f, "\nMultipartField: {}", self.ct)?; writeln!(f, " boundary: {}", self.inner.borrow().boundary)?;