Skip to content

Commit 7704f7b

Browse files
committed
Auto merge of #4384 - ivanbakel:unused_mut, r=alexcrichton
Fixed some variables being unnecessarily mutable ### Changes Some variables are marked `mut` when they don't need to be. This PR changes those variables to no longer be `mut`. ### Context PR on rust-lang/rust#43582 tl:dr; There's a bug with the mutability checker that sometimes marks mutable ref variables as being used when they're not.
2 parents cae3943 + 1486f42 commit 7704f7b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cargo/core/resolver/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ impl<'a> Context<'a> {
11091109
if !used_features.is_empty() {
11101110
let pkgid = candidate.package_id();
11111111

1112-
let mut set = self.resolve_features.entry(pkgid.clone())
1112+
let set = self.resolve_features.entry(pkgid.clone())
11131113
.or_insert_with(HashSet::new);
11141114
for feature in used_features {
11151115
if !set.contains(feature) {

src/cargo/util/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ impl Config {
482482
format!("failed to load TOML configuration from `{}`", credentials.display())
483483
})?;
484484

485-
let mut cfg = match *cfg {
485+
let cfg = match *cfg {
486486
CV::Table(ref mut map, _) => map,
487487
_ => unreachable!(),
488488
};

src/cargo/util/read2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod imp {
1212

1313
pub fn read2(mut out_pipe: ChildStdout,
1414
mut err_pipe: ChildStderr,
15-
mut data: &mut FnMut(bool, &mut Vec<u8>, bool)) -> io::Result<()> {
15+
data: &mut FnMut(bool, &mut Vec<u8>, bool)) -> io::Result<()> {
1616
unsafe {
1717
libc::fcntl(out_pipe.as_raw_fd(), libc::F_SETFL, libc::O_NONBLOCK);
1818
libc::fcntl(err_pipe.as_raw_fd(), libc::F_SETFL, libc::O_NONBLOCK);
@@ -102,7 +102,7 @@ mod imp {
102102

103103
pub fn read2(out_pipe: ChildStdout,
104104
err_pipe: ChildStderr,
105-
mut data: &mut FnMut(bool, &mut Vec<u8>, bool)) -> io::Result<()> {
105+
data: &mut FnMut(bool, &mut Vec<u8>, bool)) -> io::Result<()> {
106106
let mut out = Vec::new();
107107
let mut err = Vec::new();
108108

0 commit comments

Comments
 (0)