mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-17 23:58:24 +00:00
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.
This commit is contained in:
1 file changed
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user