Skip to content

Commit

Permalink
Fix clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Stupremee committed Jul 7, 2022
1 parent 9872570 commit f82c6c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/advisories/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,18 +567,23 @@ where
// we try to give a more helpful error message about precisely what we
// tried.
let res = res.map_err(|_e| {
use std::fmt::Write;

let mut msg = "failed to authenticate when downloading repository".to_owned();
if !ssh_agent_attempts.is_empty() {
let names = ssh_agent_attempts
.iter()
.map(|s| format!("`{}`", s))
.collect::<Vec<_>>()
.join(", ");
msg.push_str(&format!(

write!(
&mut msg,
"\nattempted ssh-agent authentication, but \
none of the usernames {} succeeded",
names
));
)
.unwrap();
}
if let Some(failed_cred_helper) = cred_helper_bad {
if failed_cred_helper {
Expand Down

0 comments on commit f82c6c8

Please sign in to comment.