Updated Utf8View example to format the single codepoint UTF-8 slice with {s} (#18288)

This commit is contained in:
davideger
2024-01-01 15:47:27 -08:00
committed by GitHub
parent 7161ed79c4
commit e426ae43ae

View File

@@ -312,7 +312,7 @@ pub fn utf8ValidateSlice(input: []const u8) bool {
/// ```
/// var utf8 = (try std.unicode.Utf8View.init("hi there")).iterator();
/// while (utf8.nextCodepointSlice()) |codepoint| {
/// std.debug.print("got codepoint {}\n", .{codepoint});
/// std.debug.print("got codepoint {s}\n", .{codepoint});
/// }
/// ```
pub const Utf8View = struct {