tokio-xmpp: rustfmt

This commit is contained in:
Astro 2020-12-25 02:25:17 +01:00
parent 52a2d962ee
commit f6cb4a8080

View file

@ -88,19 +88,28 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
Poll::Ready(Ok(())) Poll::Ready(Ok(()))
} }
fn start_send(#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>, item: Packet) -> Result<(), Self::Error> { fn start_send(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
item: Packet,
) -> Result<(), Self::Error> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut()) Pin::new(&mut self.stream.lock().unwrap().deref_mut())
.start_send(item) .start_send(item)
.map_err(|e| e.into()) .map_err(|e| e.into())
} }
fn poll_flush(#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<(), Self::Error>> { fn poll_flush(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Result<(), Self::Error>> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut()) Pin::new(&mut self.stream.lock().unwrap().deref_mut())
.poll_flush(cx) .poll_flush(cx)
.map_err(|e| e.into()) .map_err(|e| e.into())
} }
fn poll_close(#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<(), Self::Error>> { fn poll_close(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Result<(), Self::Error>> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut()) Pin::new(&mut self.stream.lock().unwrap().deref_mut())
.poll_close(cx) .poll_close(cx)
.map_err(|e| e.into()) .map_err(|e| e.into())
@ -111,7 +120,10 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
impl<S: AsyncRead + AsyncWrite + Unpin> Stream for XMPPStream<S> { impl<S: AsyncRead + AsyncWrite + Unpin> Stream for XMPPStream<S> {
type Item = Result<Packet, crate::Error>; type Item = Result<Packet, crate::Error>;
fn poll_next(#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> { fn poll_next(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Option<Self::Item>> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut()) Pin::new(&mut self.stream.lock().unwrap().deref_mut())
.poll_next(cx) .poll_next(cx)
.map(|result| result.map(|result| result.map_err(|e| e.into()))) .map(|result| result.map(|result| result.map_err(|e| e.into())))