File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -561,7 +561,7 @@ pub fn formatIntValue(
561
561
if (@typeInfo (@TypeOf (int_value )).Int .bits <= 21 ) {
562
562
return formatUnicodeCodepoint (@as (u21 , int_value ), options , writer );
563
563
} else {
564
- @compileError ("Cannot print integer that is larger than 32 bits as an UTF-8 sequence" );
564
+ @compileError ("Cannot print integer that is larger than 21 bits as an UTF-8 sequence" );
565
565
}
566
566
} else if (comptime std .mem .eql (u8 , fmt , "b" )) {
567
567
radix = 2 ;
@@ -657,7 +657,7 @@ pub fn formatUnicodeCodepoint(
657
657
if (unicode .utf8ValidCodepoint (c )) {
658
658
var buf : [4 ]u8 = undefined ;
659
659
// The codepoint is surely valid, hence the use of unreachable
660
- const len = std .unicode .utf8Encode (@truncate ( u21 , c ) , & buf ) catch | err | switch (err ) {
660
+ const len = std .unicode .utf8Encode (c , & buf ) catch | err | switch (err ) {
661
661
error .Utf8CannotEncodeSurrogateHalf , error .CodepointTooLarge = > unreachable ,
662
662
};
663
663
return formatBuf (buf [0.. len ], options , writer );
You can’t perform that action at this time.
0 commit comments