Extend build fix workaround from 1.48 to 1.46

This commit is contained in:
Paul Fariello 2021-02-16 00:20:40 +01:00 committed by Astro
parent 8d3c7a3bd6
commit 15255a6b30

View file

@ -89,7 +89,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
}
fn start_send(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
item: Packet,
) -> Result<(), Self::Error> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut())
@ -98,7 +98,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
}
fn poll_flush(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Result<(), Self::Error>> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut())
@ -107,7 +107,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Sink<Packet> for XMPPStream<S> {
}
fn poll_close(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Result<(), Self::Error>> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut())
@ -121,7 +121,7 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Stream for XMPPStream<S> {
type Item = Result<Packet, crate::Error>;
fn poll_next(
#[cfg_attr(rustc_least_1_48, allow(unused_mut))] mut self: Pin<&mut Self>,
#[cfg_attr(rustc_least_1_46, allow(unused_mut))] mut self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Option<Self::Item>> {
Pin::new(&mut self.stream.lock().unwrap().deref_mut())