From 6b272dc857c1c1be431d9a8d760a3bdceda55692 Mon Sep 17 00:00:00 2001 From: Mex <44814932+MMexicann@users.noreply.github.com> Date: Sun, 15 Nov 2026 19:52:54 +0100 Subject: [PATCH] M0.9: reuse printable diagnostic text at the CLI boundary Expose the existing plain helper within the crate so final CLI errors use exactly the same escaping rule as file and script diagnostics. --- apps/figcraft-cli/src/files.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 165057086..59dec2abf 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -12,7 +12,7 @@ use crate::{CliError, CliResult}; /// A document's or plugin's text as a terminal should show it: control characters escaped, and /// everything else (quotes, backslashes in paths) left as it is. -fn plain(text: &str) -> String { +pub(crate) fn plain(text: &str) -> String { text.chars().map(|c| if c.is_control() { c.escape_default().to_string() } else { c.to_string() }).collect() }