File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ fn readclose(fd: fd_t) -> str {
85
85
let buf = "" ;
86
86
while !reader. eof ( ) {
87
87
let bytes = reader. read_bytes ( 4096 u) ;
88
- buf += str:: unsafe_from_bytes ( bytes) ;
88
+ buf += str:: from_bytes ( bytes) ;
89
89
}
90
90
os:: fclose ( file) ;
91
91
ret buf;
@@ -114,8 +114,8 @@ fn worker(p: port<request>) {
114
114
// the alt discriminant are wrong.
115
115
alt recv ( p) {
116
116
exec ( lib_path, prog, args, respchan) {
117
- { lib_path: str :: unsafe_from_bytes ( lib_path) ,
118
- prog: str:: unsafe_from_bytes ( prog) ,
117
+ { lib_path: str :: from_bytes ( lib_path) ,
118
+ prog: str:: from_bytes ( prog) ,
119
119
args: clone_vecu8str ( args) ,
120
120
respchan: respchan}
121
121
}
@@ -189,7 +189,7 @@ fn clone_vecstr(v: [str]) -> [[u8]] {
189
189
fn clone_vecu8str ( v : [ [ u8 ] ] ) -> [ str ] {
190
190
let r = [ ] ;
191
191
for t in vec:: slice ( v, 0 u, vec:: len ( v) ) {
192
- r += [ str:: unsafe_from_bytes ( t) ] ;
192
+ r += [ str:: from_bytes ( t) ] ;
193
193
}
194
194
ret r;
195
195
}
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ mod rt {
390
390
fn str_init_elt ( n_elts : uint , c : char ) -> str {
391
391
let svec = vec:: init_elt :: < u8 > ( n_elts, c as u8 ) ;
392
392
393
- ret str:: unsafe_from_bytes ( svec) ;
393
+ ret str:: from_bytes ( svec) ;
394
394
}
395
395
enum pad_mode { pad_signed, pad_unsigned, pad_nozero, }
396
396
fn pad ( cv : conv , s : str , mode : pad_mode ) -> str {
@@ -439,7 +439,7 @@ mod rt {
439
439
if signed && zero_padding && str:: byte_len ( s) > 0 u {
440
440
let head = s[ 0 ] ;
441
441
if head == '+' as u8 || head == '-' as u8 || head == ' ' as u8 {
442
- let headstr = str:: unsafe_from_bytes ( [ head] ) ;
442
+ let headstr = str:: from_bytes ( [ head] ) ;
443
443
// FIXME: not UTF-8 safe
444
444
let bytelen = str:: byte_len ( s) ;
445
445
let numpart = str:: substr ( s, 1 u, bytelen - 1 u) ;
You can’t perform that action at this time.
0 commit comments