diff --git a/CHANGES.md b/CHANGES.md index 13eeb67d..47b0f987 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 c9aed94f..9a0a0880 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 50ef3813..65a64d5e 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)?;