Byte index slicing like `&text[..100.min(text.len())]` panics when the byte index falls inside a multi-byte UTF-8 character (e.g., Chinese). Changed to `text.chars().take(100).collect::<String>()` for safe character-based truncation.
Byte index slicing like `&text[..100.min(text.len())]` panics when the byte index falls inside a multi-byte UTF-8 character (e.g., Chinese). Changed to `text.chars().take(100).collect::<String>()` for safe character-based truncation.