Skip to content

Commit 43de933

Browse files
Merge pull request #825 from nbdd0121/master
Fix unused_mut warning in nightly
2 parents 17ab958 + 2e7e804 commit 43de933

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

Diff for: src/io/stderr.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ enum Operation {
8989

9090
impl Write for Stderr {
9191
fn poll_write(
92-
mut self: Pin<&mut Self>,
92+
self: Pin<&mut Self>,
9393
cx: &mut Context<'_>,
9494
buf: &[u8],
9595
) -> Poll<io::Result<usize>> {
96-
let state = &mut *self.0.lock().unwrap();
96+
let mut state_guard = self.0.lock().unwrap();
97+
let state = &mut *state_guard;
9798

9899
loop {
99100
match state {
@@ -137,8 +138,9 @@ impl Write for Stderr {
137138
}
138139
}
139140

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

143145
loop {
144146
match state {

Diff for: src/io/stdin.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,12 @@ impl Stdin {
149149

150150
impl Read for Stdin {
151151
fn poll_read(
152-
mut self: Pin<&mut Self>,
152+
self: Pin<&mut Self>,
153153
cx: &mut Context<'_>,
154154
buf: &mut [u8],
155155
) -> Poll<io::Result<usize>> {
156-
let state = &mut *self.0.lock().unwrap();
156+
let mut state_guard = self.0.lock().unwrap();
157+
let state = &mut *state_guard;
157158

158159
loop {
159160
match state {

Diff for: src/io/stdout.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ enum Operation {
8989

9090
impl Write for Stdout {
9191
fn poll_write(
92-
mut self: Pin<&mut Self>,
92+
self: Pin<&mut Self>,
9393
cx: &mut Context<'_>,
9494
buf: &[u8],
9595
) -> Poll<io::Result<usize>> {
96-
let state = &mut *self.0.lock().unwrap();
96+
let mut state_guard = self.0.lock().unwrap();
97+
let state = &mut *state_guard;
9798

9899
loop {
99100
match state {
@@ -137,8 +138,9 @@ impl Write for Stdout {
137138
}
138139
}
139140

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

143145
loop {
144146
match state {

0 commit comments

Comments
 (0)