From d4f48fd1ebdcc204deb52e0b6074788b1196a001 Mon Sep 17 00:00:00 2001 From: brgr-s Date: Thu, 28 May 2026 00:14:06 +0200 Subject: [PATCH] update whole_unicode_string_fits test truncate at 5 is fine and will not lead to the "end byte index is not a char boundary" result with the original code, which seems to be expected according to slides --- examples/04_truncate_string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/04_truncate_string.rs b/examples/04_truncate_string.rs index b433373..adf2bc3 100644 --- a/examples/04_truncate_string.rs +++ b/examples/04_truncate_string.rs @@ -22,6 +22,6 @@ mod tests { #[test] fn whole_unicode_string_fits() { - assert_eq!(truncate("café", 5), "café"); + assert_eq!(truncate("café", 4), "caf"); } }