From 088e1c2f28676b71896eca5365367508918b87f3 Mon Sep 17 00:00:00 2001 From: Barney <86712892+BigBoyBarney@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:37:00 +0200 Subject: [PATCH] Update byte_format.cr example to not use uninitialized --- src/io/byte_format.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/io/byte_format.cr b/src/io/byte_format.cr index d8f7e4cb5e71..25991ade7c46 100644 --- a/src/io/byte_format.cr +++ b/src/io/byte_format.cr @@ -20,9 +20,9 @@ # ### Encode to bytes # # ``` -# raw = uninitialized UInt8[2] -# IO::ByteFormat::LittleEndian.encode(0x1234_i16, raw.to_slice) -# raw # => StaticArray[0x34, 0x12] +# bytes = StaticArray(UInt8, 2).new 0 +# IO::ByteFormat::LittleEndian.encode(0x1234_i16, bytes.to_slice) +# bytes # => StaticArray[0x34, 0x12] # ``` # # ### Encode to IO