From b1347726c539fc710256dfeb602dcd87ef71f627 Mon Sep 17 00:00:00 2001 From: Krzysztof Miciul <44015604+Dem0lKa@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:25:47 +0200 Subject: [PATCH] cast.md improvements for signed boundary case casting Rewrite comment for boundary case casting to signed value to avoid confusion between "as u8" in comment and "as i8" in print. --- src/types/cast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/cast.md b/src/types/cast.md index 3078d82c1e..7e944d04c6 100644 --- a/src/types/cast.md +++ b/src/types/cast.md @@ -53,7 +53,7 @@ fn main() { // Unless it already fits, of course. println!(" 128 as a i16 is: {}", 128 as i16); - // 128 as u8 -> 128, whose value in 8-bit two's complement representation is: + // In boundary case 128 value in 8-bit two's complement representation is -128 println!(" 128 as a i8 is : {}", 128 as i8); // repeating the example above