Skip to content

Commit fa4a746

Browse files
author
Arnavion
committed
Fixed build on nightly.
The fix for rust-lang/rust#51117 exposed some other double mutable borrows, which are difficult to work around without enabling NLL.
1 parent f1731bf commit fa4a746

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! A CLI tool to manage Factorio mods.
22
3-
#![feature(catch_expr, exhaustive_patterns, generators, never_type, proc_macro, proc_macro_non_items, proc_macro_path_invoc)]
3+
#![feature(catch_expr, exhaustive_patterns, generators, never_type, nll, proc_macro, proc_macro_non_items, proc_macro_path_invoc)]
44

55
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
66
#![cfg_attr(feature = "cargo-clippy", allow(

src/solve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use ::ResultExt;
88
pub fn compute_and_apply_diff<'a>(
99
local_api: &'a ::factorio_mods_local::API,
1010
web_api: &'a ::factorio_mods_web::API,
11-
mut config: ::config::Config,
11+
config: ::config::Config, // TODO: Should be `mut` but triggers warning due to https://github.com/rust-lang/rust/issues/50897
1212
prompt_override: Option<bool>,
1313
) -> impl Future<Item = (), Error = ::Error> + 'a {
1414
::async_block! {

src/util.rs

+5-14
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,11 @@ pub fn ensure_user_credentials<'a>(
4646
Ok(user_credentials) =>
4747
return Ok(user_credentials),
4848

49-
Err(err) => {
50-
let existing_username = if let ::factorio_mods_local::ErrorKind::IncompleteUserCredentials(ref existing_username) = *err.kind() {
51-
Some(existing_username.clone())
52-
}
53-
else {
54-
None
55-
};
56-
57-
if let Some(existing_username) = existing_username {
58-
existing_username
59-
}
60-
else {
61-
return Err(err).chain_err(|| "Could not read user credentials");
62-
}
49+
Err(err) => if let ::factorio_mods_local::ErrorKind::IncompleteUserCredentials(existing_username) = err.kind() {
50+
existing_username.clone()
51+
}
52+
else {
53+
return Err(err).chain_err(|| "Could not read user credentials");
6354
},
6455
};
6556

0 commit comments

Comments
 (0)