@@ -46,6 +46,7 @@ use tokio_util::codec::{BytesCodec, FramedRead};
4646/// # }
4747/// # tokio::runtime::Runtime::new().unwrap().block_on(run());
4848/// ```
49+ #[ derive( Debug ) ]
4950pub struct Multipart {
5051 state : Arc < Mutex < MultipartState > > ,
5152 constraints : Constraints ,
@@ -124,9 +125,6 @@ impl Multipart {
124125 ///
125126 /// ```
126127 /// use multer::Multipart;
127- /// use bytes::Bytes;
128- /// use std::convert::Infallible;
129- /// use futures::stream::once;
130128 ///
131129 /// # async fn run() {
132130 /// let data = "--X-BOUNDARY\r\nContent-Disposition: form-data; name=\"my_text_field\"\r\n\r\nabcd\r\n--X-BOUNDARY--\r\n";
@@ -161,9 +159,6 @@ impl Multipart {
161159 ///
162160 /// ```
163161 /// use multer::Multipart;
164- /// use bytes::Bytes;
165- /// use std::convert::Infallible;
166- /// use futures::stream::once;
167162 ///
168163 /// # async fn run() {
169164 /// let data = "--X-BOUNDARY\r\nContent-Disposition: form-data; name=\"my_text_field\"\r\n\r\nabcd\r\n--X-BOUNDARY--\r\n";
@@ -202,12 +197,10 @@ impl Multipart {
202197 /// # Examples
203198 ///
204199 /// ```
200+ /// # #[cfg(feature = "reader")]
201+ /// # {
205202 /// use multer::Multipart;
206- /// use bytes::Bytes;
207- /// use std::convert::Infallible;
208- /// use futures::stream::once;
209203 ///
210- /// # #[cfg(feature = "reader")]
211204 /// # async fn run() {
212205 /// let data = "--X-BOUNDARY\r\nContent-Disposition: form-data; name=\"my_text_field\"\r\n\r\nabcd\r\n--X-BOUNDARY--\r\n";
213206 /// let reader = data.as_bytes();
@@ -217,8 +210,8 @@ impl Multipart {
217210 /// println!("Index: {:?}, Content: {:?}", idx, field.text().await)
218211 /// }
219212 /// # }
220- /// # #[cfg(feature = "reader")]
221213 /// # tokio::runtime::Runtime::new().unwrap().block_on(run());
214+ /// # }
222215 /// ```
223216 pub async fn next_field_with_idx ( & mut self ) -> crate :: Result < Option < ( usize , Field ) > > {
224217 self . try_next ( ) . await . map ( |f| f. map ( |field| ( field. index ( ) , field) ) )
@@ -228,7 +221,7 @@ impl Multipart {
228221impl Stream for Multipart {
229222 type Item = Result < Field , crate :: Error > ;
230223
231- fn poll_next ( self : Pin < & mut Self > , cx : & mut Context ) -> Poll < Option < Self :: Item > > {
224+ fn poll_next ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
232225 let mut mutex_guard = match self . state . lock ( ) {
233226 Ok ( lock) => lock,
234227 Err ( err) => {
0 commit comments