Skip to content

Commit

Permalink
Merge pull request #825 from nbdd0121/master
Browse files Browse the repository at this point in the history
Fix unused_mut warning in nightly
  • Loading branch information
dignifiedquire committed Jun 25, 2020
2 parents 17ab958 + 2e7e804 commit 43de933
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
10 changes: 6 additions & 4 deletions src/io/stderr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ enum Operation {

impl Write for Stderr {
fn poll_write(
mut self: Pin<&mut Self>,
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> 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 {
match state {
Expand Down Expand Up @@ -137,8 +138,9 @@ impl Write for Stderr {
}
}

fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
let state = &mut *self.0.lock().unwrap();
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;

loop {
match state {
Expand Down
5 changes: 3 additions & 2 deletions src/io/stdin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ impl Stdin {

impl Read for Stdin {
fn poll_read(
mut self: Pin<&mut Self>,
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> 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 {
match state {
Expand Down
10 changes: 6 additions & 4 deletions src/io/stdout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ enum Operation {

impl Write for Stdout {
fn poll_write(
mut self: Pin<&mut Self>,
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> 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 {
match state {
Expand Down Expand Up @@ -137,8 +138,9 @@ impl Write for Stdout {
}
}

fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
let state = &mut *self.0.lock().unwrap();
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
let mut state_guard = self.0.lock().unwrap();
let state = &mut *state_guard;

loop {
match state {
Expand Down

0 comments on commit 43de933

Please sign in to comment.