Skip to content

Commit a66372e

Browse files
Merge #958
958: fix missing formats in diagnostics r=Alexhuszagh a=Emilgardis Co-authored-by: Emil Gardström <[email protected]>
2 parents 3f60cc1 + b78bd58 commit a66372e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/bin/commands/containers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ pub fn create_persistent_volume(
416416
// stop the container if it's already running
417417
let state = docker::remote::container_state(engine, &container, msg_info)?;
418418
if !state.is_stopped() {
419-
msg_info.warn("container {container} was running.")?;
419+
msg_info.warn(format_args!("container {container} was running."))?;
420420
docker::remote::container_stop_default(engine, &container, msg_info)?;
421421
}
422422
if state.exists() {
423-
msg_info.warn("container {container} was exited.")?;
423+
msg_info.warn(format_args!("container {container} was exited."))?;
424424
docker::remote::container_rm(engine, &container, msg_info)?;
425425
}
426426

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl Config {
222222
.replace(|c| c == '-' || c == '_', "")
223223
.to_lowercase();
224224
if mentioned_target != target && mentioned_target_norm == target_norm {
225-
msg_info.warn("a target named \"{mentioned_target}\" is mentioned in the Cross configuration, but the current specified target is \"{target}\".")?;
225+
msg_info.warn(format_args!("a target named \"{mentioned_target}\" is mentioned in the Cross configuration, but the current specified target is \"{target}\"."))?;
226226
msg_info.status(" > Is the target misspelled in the Cross configuration?")?;
227227
}
228228
}

src/cross_toml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl CrossToml {
183183
})?;
184184

185185
if !unused.is_empty() {
186-
msg_info.warn(format!(
186+
msg_info.warn(format_args!(
187187
"found unused key(s) in Cross configuration:\n > {}",
188188
unused.clone().into_iter().collect::<Vec<_>>().join(", ")
189189
))?;

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ fn warn_on_failure(
476476
if target.is_builtin() {
477477
let component = rustup::check_component(&rust_std, toolchain, msg_info)?;
478478
if component.is_not_available() {
479-
msg_info.warn(format!("rust-std is not available for {target}"))?;
479+
msg_info.warn(format_args!("rust-std is not available for {target}"))?;
480480
msg_info.note(
481481
format_args!(
482482
r#"you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.{target}.build-std`
@@ -502,7 +502,7 @@ pub fn run(
502502
) -> Result<Option<ExitStatus>> {
503503
if args.version && args.subcommand.is_none() {
504504
let commit_info = include_str!(concat!(env!("OUT_DIR"), "/commit-info.txt"));
505-
msg_info.print(format!(
505+
msg_info.print(format_args!(
506506
concat!("cross ", env!("CARGO_PKG_VERSION"), "{}"),
507507
commit_info
508508
))?;
@@ -756,15 +756,15 @@ pub(crate) fn warn_host_version_mismatch(
756756
host_version_meta.short_version_string
757757
);
758758
if versions.is_lt() || (versions.is_eq() && dates.is_lt()) {
759-
msg_info.warn(format!("using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`"))?;
759+
msg_info.warn(format_args!("using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`"))?;
760760
return Ok(VersionMatch::OlderTarget);
761761
} else if versions.is_gt() || (versions.is_eq() && dates.is_gt()) {
762-
msg_info.warn(format!(
762+
msg_info.warn(format_args!(
763763
"using newer {rustc_warning}.\n > Update with `rustup update`"
764764
))?;
765765
return Ok(VersionMatch::NewerTarget);
766766
} else {
767-
msg_info.warn(format!("using {rustc_warning}."))?;
767+
msg_info.warn(format_args!("using {rustc_warning}."))?;
768768
return Ok(VersionMatch::Different);
769769
}
770770
}

0 commit comments

Comments
 (0)