fix: filter_map requires to return an Option

pull/920/head
zhangzhonglai 3 years ago
parent 20cb1fc718
commit 729030f387

@ -184,7 +184,7 @@ got = b"6"
let messages = subscriber let messages = subscriber
.into_stream() .into_stream()
.filter_map(|msg| match msg { .filter_map(|msg| match msg {
Ok(msg) if msg.content.len() == 1 => msg.unwrap().content, Ok(msg) if msg.content.len() == 1 => Some(msg.content),
_ => None, _ => None,
}) })
.take(3); .take(3);

Loading…
Cancel
Save