Skip to content

Commit

Permalink
errors: Reorder component-unavailable message parts
Browse files Browse the repository at this point in the history
The ordering of some of the parts of the component-unavailable
error message was unfortunate, resulting in confusion.  This
reorders those so that errors are slightly clearer.

Fixes: rust-lang#1768

Signed-off-by: Daniel Silverstone <[email protected]>
  • Loading branch information
kinnison committed Apr 15, 2019
1 parent 5d1db84 commit a60c989
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ error_chain! {
}
RequestedComponentsUnavailable(c: Vec<Component>, manifest: Manifest, toolchain: String) {
description("some requested components are unavailable to download")
display("{} for channel '{}'", component_unavailable_msg(&c, &manifest), toolchain)
display("{} for channel '{}'\n{}", component_unavailable_msg(&c, &manifest), toolchain, TOOLSTATE_MSG)
}
UnknownMetadataVersion(v: String) {
description("unknown metadata version")
Expand Down Expand Up @@ -341,19 +341,11 @@ fn component_unavailable_msg(cs: &[Component], manifest: &Manifest) -> String {
if same_target {
let mut cs_strs = cs.iter().map(|c| format!("'{}'", c.short_name(manifest)));
let cs_str = cs_strs.join(", ");
let _ = write!(
buf,
"some components unavailable for download: {}\n{}",
cs_str, TOOLSTATE_MSG,
);
let _ = write!(buf, "some components unavailable for download: {}", cs_str,);
} else {
let mut cs_strs = cs.iter().map(|c| c.description(manifest));
let cs_str = cs_strs.join(", ");
let _ = write!(
buf,
"some components unavailable for download: {}\n{}",
cs_str, TOOLSTATE_MSG,
);
let _ = write!(buf, "some components unavailable for download: {}", cs_str,);
}
}

Expand Down

0 comments on commit a60c989

Please sign in to comment.