swiftide_core::util

Function debug_long_utf8

source
pub fn debug_long_utf8(s: impl AsRef<str>, max_chars: usize) -> String
Expand description

Debug print a long string by truncating to n characters

ยงExample

let s = debug_long_utf8("๐Ÿฆ€".repeat(10), 3);

assert_eq!(s, "๐Ÿฆ€๐Ÿฆ€๐Ÿฆ€ (10)");