2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 10:49:55 +00:00

Fix unused_mut warning in nightly

This commit is contained in:
Gary Guo 2020-06-25 17:44:39 +01:00
parent 17ab958ac2
commit 2e7e804736
3 changed files with 15 additions and 10 deletions

View file

@ -89,11 +89,12 @@ enum Operation {
impl Write for Stderr { impl Write for Stderr {
fn poll_write( fn poll_write(
mut self: Pin<&mut Self>, self: Pin<&mut Self>,
cx: &mut Context<'_>, cx: &mut Context<'_>,
buf: &[u8], buf: &[u8],
) -> Poll<io::Result<usize>> { ) -> Poll<io::Result<usize>> {
let state = &mut *self.0.lock().unwrap(); let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;
loop { loop {
match state { match state {
@ -137,8 +138,9 @@ impl Write for Stderr {
} }
} }
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> { fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
let state = &mut *self.0.lock().unwrap(); let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;
loop { loop {
match state { match state {

View file

@ -149,11 +149,12 @@ impl Stdin {
impl Read for Stdin { impl Read for Stdin {
fn poll_read( fn poll_read(
mut self: Pin<&mut Self>, self: Pin<&mut Self>,
cx: &mut Context<'_>, cx: &mut Context<'_>,
buf: &mut [u8], buf: &mut [u8],
) -> Poll<io::Result<usize>> { ) -> Poll<io::Result<usize>> {
let state = &mut *self.0.lock().unwrap(); let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;
loop { loop {
match state { match state {

View file

@ -89,11 +89,12 @@ enum Operation {
impl Write for Stdout { impl Write for Stdout {
fn poll_write( fn poll_write(
mut self: Pin<&mut Self>, self: Pin<&mut Self>,
cx: &mut Context<'_>, cx: &mut Context<'_>,
buf: &[u8], buf: &[u8],
) -> Poll<io::Result<usize>> { ) -> Poll<io::Result<usize>> {
let state = &mut *self.0.lock().unwrap(); let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;
loop { loop {
match state { match state {
@ -137,8 +138,9 @@ impl Write for Stdout {
} }
} }
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> { fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
let state = &mut *self.0.lock().unwrap(); let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;
loop { loop {
match state { match state {