Skip to content

Commit

Permalink
clippy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy J. Miller <[email protected]>
  • Loading branch information
jeremymv2 committed Jul 28, 2020
1 parent 9d22ef5 commit 5c56610
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions components/builder-api-client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,8 @@ impl BuilderAPIClient {
/// # Failures
///
/// * Remote Builder is not available
/// * Unprocessable role
/// * Insufficient Privileges
pub async fn update_member_role(&self,
origin: &str,
token: &str,
Expand Down
6 changes: 2 additions & 4 deletions components/hab/src/command/origin/rbac/set_role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ pub async fn start(ui: &mut UI,
ui.begin(format!("Preparing to update member {}'s role to '{}' in {} origin.",
member_account, role, origin))?;

if !no_prompt {
if !confirm_update_role(ui)? {
return Ok(());
};
if !no_prompt && !confirm_update_role(ui)? {
return Ok(());
}

match api_client.update_member_role(origin, token, member_account, role)
Expand Down
7 changes: 4 additions & 3 deletions components/hab/src/command/origin/rbac/show_role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ pub async fn start(ui: &mut UI,
}
} else {
ui.status(Status::Discovering, "origin member role".to_string())?;
println!("Member {} has the '{}' role in origin {}",
println!("Member {} has the '{}' role in the {} origin.",
member_account, resp.role, origin);
Ok(())
}
}
Err(err @ api_client::Error::APIError(StatusCode::FORBIDDEN, _)) => {
ui.fatal("Failed to get origin member's role!")?;
ui.fatal("This situation could arise, if for example, you are not a member with \
sufficient privileges in the origin.")?;
ui.fatal(format!("This situation could arise, if for example, you are not a member \
with sufficient privileges in the '{}' origin.",
origin))?;
Err(Error::APIClient(err))
}
Err(err @ api_client::Error::APIError(StatusCode::NOT_FOUND, _)) => {
Expand Down

0 comments on commit 5c56610

Please sign in to comment.