From 52713a478188203a4b4a6592e7014d5a4ef44495 Mon Sep 17 00:00:00 2001 From: Count Count Date: Wed, 24 Mar 2021 07:06:24 +0100 Subject: [PATCH] fix --- library/std/src/sys/windows/stdio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/windows/stdio.rs index 19fd900580b3..1ca10de037c2 100644 --- a/library/std/src/sys/windows/stdio.rs +++ b/library/std/src/sys/windows/stdio.rs @@ -128,7 +128,7 @@ fn write( let utf8 = match str::from_utf8(&data[..len]) { Ok(s) => s, Err(ref e) if e.valid_up_to() == 0 => { - first_byte_char_width = utf8_char_width(data[0]); + let first_byte_char_width = utf8_char_width(data[0]); if first_byte_char_width > 1 && data.len() < first_byte_char_width { incomplete_utf8.bytes[0] = data[0]; incomplete_utf8.len = 1;