Skip to content

Commit bf8b318

Browse files
committed
---
yaml --- r: 273097 b: refs/heads/beta c: 6993939 h: refs/heads/master i: 273095: 8660592
1 parent a620e58 commit bf8b318

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 8427efaab377346c0c4be73664422897a4072330
26+
refs/heads/beta: 69939392425f160055378f190a65094a96c5cdbc
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libstd/sys/windows/stdio.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ fn write(out: &Output, data: &[u8]) -> io::Result<usize> {
6969
// [1]: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1232
7070
// [2]: http://www.mail-archive.com/[email protected]/msg00661.html
7171
const OUT_MAX: usize = 8192;
72-
let data_len;
73-
let utf16 = match str::from_utf8(data).ok() {
72+
let (utf16, data_len) = match str::from_utf8(data).ok() {
7473
Some(mut utf8) => {
7574
if utf8.len() > OUT_MAX {
7675
let mut new_len = OUT_MAX;
@@ -79,8 +78,7 @@ fn write(out: &Output, data: &[u8]) -> io::Result<usize> {
7978
}
8079
utf8 = &utf8[..new_len];
8180
}
82-
data_len = utf8.len();
83-
utf8.encode_utf16().collect::<Vec<u16>>()
81+
(utf8.encode_utf16().collect::<Vec<u16>>(), utf8.len())
8482
}
8583
None => return Err(invalid_encoding()),
8684
};

0 commit comments

Comments
 (0)