File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -804,11 +804,11 @@ pub trait AsyncBufReadExt: AsyncBufRead {
804
804
/// use futures::io::{AsyncBufReadExt, Cursor};
805
805
/// use futures::stream::StreamExt;
806
806
///
807
- /// let cursor = Cursor::new(b"lorem\nipsum\r\ndolor");
807
+ /// let cursor = Cursor::new(b"lorem\nipsum\xc2\ r\ndolor");
808
808
///
809
- /// let mut lines_stream = cursor.lines().map(|l| l.unwrap( ));
809
+ /// let mut lines_stream = cursor.lines().map(|l| l.unwrap_or(String::from("invalid UTF_8") ));
810
810
/// assert_eq!(lines_stream.next().await, Some(String::from("lorem")));
811
- /// assert_eq!(lines_stream.next().await, Some(String::from("ipsum ")));
811
+ /// assert_eq!(lines_stream.next().await, Some(String::from("invalid UTF_8 ")));
812
812
/// assert_eq!(lines_stream.next().await, Some(String::from("dolor")));
813
813
/// assert_eq!(lines_stream.next().await, None);
814
814
/// # Ok::<(), Box<dyn std::error::Error>>(()) }).unwrap();
You can’t perform that action at this time.
0 commit comments