Skip to content

Commit fdf2dba

Browse files
committed
---
yaml --- r: 14250 b: refs/heads/try c: 8d29e87 h: refs/heads/master v: v3
1 parent bd5b4c0 commit fdf2dba

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: e5cc9193f8b91f8d21621b452e45d0e37c200757
5+
refs/heads/try: 8d29e8705626e28d3bf96d194dd97311e1967995
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/str.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,14 @@ Function: from_cstr
195195
Create a Rust string from a null-terminated C string
196196
*/
197197
unsafe fn from_cstr(cstr: sbuf) -> str {
198-
let res = [];
199198
let start = cstr;
200199
let curr = start;
201200
let i = 0u;
202201
while *curr != 0u8 {
203-
vec::push(res, *curr);
204202
i += 1u;
205203
curr = ptr::offset(start, i);
206204
}
207-
ret from_bytes(res);
205+
ret from_cstr_len(cstr, i);
208206
}
209207

210208
/*

0 commit comments

Comments
 (0)