File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: e5cc9193f8b91f8d21621b452e45d0e37c200757
5
+ refs/heads/try: 8d29e8705626e28d3bf96d194dd97311e1967995
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -195,16 +195,14 @@ Function: from_cstr
195
195
Create a Rust string from a null-terminated C string
196
196
*/
197
197
unsafe fn from_cstr ( cstr : sbuf ) -> str {
198
- let res = [ ] ;
199
198
let start = cstr;
200
199
let curr = start;
201
200
let i = 0 u;
202
201
while * curr != 0u8 {
203
- vec:: push ( res, * curr) ;
204
202
i += 1 u;
205
203
curr = ptr:: offset ( start, i) ;
206
204
}
207
- ret from_bytes ( res ) ;
205
+ ret from_cstr_len ( cstr , i ) ;
208
206
}
209
207
210
208
/*
You can’t perform that action at this time.
0 commit comments