xmlstream: use Stanza for XmppStreamElement
Oftentimes, Stanza is at hand anyway, so this saves some typing.
This commit is contained in:
parent
c6f928d5c8
commit
56ce57ecde
5 changed files with 23 additions and 60 deletions
|
|
@ -18,14 +18,8 @@ impl<C: ServerConnector> Stream for Component<C> {
|
|||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
loop {
|
||||
match Pin::new(&mut self.stream).poll_next(cx) {
|
||||
Poll::Ready(Some(Ok(XmppStreamElement::Iq(stanza)))) => {
|
||||
return Poll::Ready(Some(Stanza::Iq(stanza)))
|
||||
}
|
||||
Poll::Ready(Some(Ok(XmppStreamElement::Message(stanza)))) => {
|
||||
return Poll::Ready(Some(Stanza::Message(stanza)))
|
||||
}
|
||||
Poll::Ready(Some(Ok(XmppStreamElement::Presence(stanza)))) => {
|
||||
return Poll::Ready(Some(Stanza::Presence(stanza)))
|
||||
Poll::Ready(Some(Ok(XmppStreamElement::Stanza(stanza)))) => {
|
||||
return Poll::Ready(Some(stanza))
|
||||
}
|
||||
Poll::Ready(Some(Ok(_))) =>
|
||||
// unexpected
|
||||
|
|
|
|||
Loading…
Reference in a new issue