Skip to content

Commit b78bd58

Browse files
committed
fix missing formats in diagnostics
1 parent 91e0377 commit b78bd58

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
@@ -182,7 +182,7 @@ impl Config {
182182
.replace(|c| c == '-' || c == '_', "")
183183
.to_lowercase();
184184
if mentioned_target != target && mentioned_target_norm == target_norm {
185-
msg_info.warn("a target named \"{mentioned_target}\" is mentioned in the Cross configuration, but the current specified target is \"{target}\".")?;
185+
msg_info.warn(format_args!("a target named \"{mentioned_target}\" is mentioned in the Cross configuration, but the current specified target is \"{target}\"."))?;
186186
msg_info.status(" > Is the target misspelled in the Cross configuration?")?;
187187
}
188188
}

src/cross_toml.rs

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

143143
if !unused.is_empty() {
144-
msg_info.warn(format!(
144+
msg_info.warn(format_args!(
145145
"found unused key(s) in Cross configuration:\n > {}",
146146
unused.clone().into_iter().collect::<Vec<_>>().join(", ")
147147
))?;

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ fn warn_on_failure(
442442
if target.is_builtin() {
443443
let component = rustup::check_component(&rust_std, toolchain, msg_info)?;
444444
if component.is_not_available() {
445-
msg_info.warn(format!("rust-std is not available for {target}"))?;
445+
msg_info.warn(format_args!("rust-std is not available for {target}"))?;
446446
msg_info.note(
447447
format_args!(
448448
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`
@@ -460,7 +460,7 @@ pub fn run(
460460
) -> Result<Option<ExitStatus>> {
461461
if args.version && args.subcommand.is_none() {
462462
let commit_info = include_str!(concat!(env!("OUT_DIR"), "/commit-info.txt"));
463-
msg_info.print(format!(
463+
msg_info.print(format_args!(
464464
concat!("cross ", env!("CARGO_PKG_VERSION"), "{}"),
465465
commit_info
466466
))?;
@@ -689,15 +689,15 @@ pub(crate) fn warn_host_version_mismatch(
689689
host_version_meta.short_version_string
690690
);
691691
if versions.is_lt() || (versions.is_eq() && dates.is_lt()) {
692-
msg_info.warn(format!("using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`"))?;
692+
msg_info.warn(format_args!("using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`"))?;
693693
return Ok(VersionMatch::OlderTarget);
694694
} else if versions.is_gt() || (versions.is_eq() && dates.is_gt()) {
695-
msg_info.warn(format!(
695+
msg_info.warn(format_args!(
696696
"using newer {rustc_warning}.\n > Update with `rustup update`"
697697
))?;
698698
return Ok(VersionMatch::NewerTarget);
699699
} else {
700-
msg_info.warn(format!("using {rustc_warning}."))?;
700+
msg_info.warn(format_args!("using {rustc_warning}."))?;
701701
return Ok(VersionMatch::Different);
702702
}
703703
}

0 commit comments

Comments
 (0)