Skip to main content

strip_thiserror_placeholders

Function strip_thiserror_placeholders 

Source
pub fn strip_thiserror_placeholders(template: &str) -> String
Expand description

Strip thiserror-style {name} placeholders from a Display template without leaving stray punctuation.

Examples:

  • "OCR error: {message}""OCR error"
  • "plugin error in '{plugin_name}'""plugin error"
  • "timed out after {elapsed_ms}ms (limit: {limit_ms}ms)""timed out"
  • "I/O error: {0}""I/O error"

Used by variant_display_message and binding error renderers (Dart, Go, …) so the literal placeholder string never reaches the runtime.