Skip to content

Commit

Permalink
Fixed build on nightly.
Browse files Browse the repository at this point in the history
The fix for rust-lang/rust#51117 exposed some other
double mutable borrows, which are difficult to work around without enabling NLL.
  • Loading branch information
Arnavion committed Jun 2, 2018
1 parent f1731bf commit fa4a746
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! A CLI tool to manage Factorio mods.
#![feature(catch_expr, exhaustive_patterns, generators, never_type, proc_macro, proc_macro_non_items, proc_macro_path_invoc)]
#![feature(catch_expr, exhaustive_patterns, generators, never_type, nll, proc_macro, proc_macro_non_items, proc_macro_path_invoc)]

#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
#![cfg_attr(feature = "cargo-clippy", allow(
Expand Down
2 changes: 1 addition & 1 deletion src/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ::ResultExt;
pub fn compute_and_apply_diff<'a>(
local_api: &'a ::factorio_mods_local::API,
web_api: &'a ::factorio_mods_web::API,
mut config: ::config::Config,
config: ::config::Config, // TODO: Should be `mut` but triggers warning due to https://github.com/rust-lang/rust/issues/50897
prompt_override: Option<bool>,
) -> impl Future<Item = (), Error = ::Error> + 'a {
::async_block! {
Expand Down
19 changes: 5 additions & 14 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,11 @@ pub fn ensure_user_credentials<'a>(
Ok(user_credentials) =>
return Ok(user_credentials),

Err(err) => {
let existing_username = if let ::factorio_mods_local::ErrorKind::IncompleteUserCredentials(ref existing_username) = *err.kind() {
Some(existing_username.clone())
}
else {
None
};

if let Some(existing_username) = existing_username {
existing_username
}
else {
return Err(err).chain_err(|| "Could not read user credentials");
}
Err(err) => if let ::factorio_mods_local::ErrorKind::IncompleteUserCredentials(existing_username) = err.kind() {
existing_username.clone()
}
else {
return Err(err).chain_err(|| "Could not read user credentials");
},
};

Expand Down

0 comments on commit fa4a746

Please sign in to comment.