1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01:00

multipart::Field renamed to MultipartField

This commit is contained in:
Nikolay Kim 2019-03-29 11:59:38 -07:00
parent 19a0b8046b
commit 709475b2bb
3 changed files with 16 additions and 13 deletions

View File

@ -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

View File

@ -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;

View File

@ -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<RefCell<InnerField>>,
safety: Safety,
}
impl Field {
impl MultipartField {
fn new(
safety: Safety,
headers: HeaderMap,
ct: mime::Mime,
inner: Rc<RefCell<InnerField>>,
) -> 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)?;