Function swiftide_core::util::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)");