File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ fn main() {
25
25
println ( "First 1024 bytes of response:" ) ;
26
26
let mut buf = [ 0 , ..1024 ] ;
27
27
match response. read ( buf) {
28
- Some ( len) => printfln ! ( "%?" , str :: from_bytes ( buf. slice_to( len) ) ) ,
28
+ Some ( len) => printfln ! ( "%?" , str :: from_utf8 ( buf. slice_to( len) ) ) ,
29
29
None => println ( "uh oh, got None :-(" ) ,
30
30
}
31
31
// TODO: read it *all*, correctly
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ pub fn from_stream_with_str<T: HeaderConvertible>(s: &str) -> Option<T> {
13
13
pub fn to_stream_into_str < T : HeaderConvertible > ( v : & T ) -> ~str {
14
14
let mut writer = MemWriter :: new ( ) ;
15
15
v. to_stream ( & mut writer) ;
16
- str:: from_bytes ( writer. buf )
16
+ str:: from_utf8 ( writer. buf )
17
17
}
18
18
19
19
// Verify that a value cannot be successfully interpreted as a header value of the specified type.
You can’t perform that action at this time.
0 commit comments