Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 59cdcdc

Browse files
committed
[T] ↔ Vec<T> as appropriate, rust-lang/rust#13165.
1 parent 8990a81 commit 59cdcdc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/examples/client/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ fn make_and_print_request(url: ~str) {
5555
Ok(body) => body,
5656
Err(err) => fail!("Reading response failed: {}", err),
5757
};
58-
println(str::from_utf8(body).expect("Uh oh, response wasn't UTF-8"));
58+
println(str::from_utf8(body.as_slice()).expect("Uh oh, response wasn't UTF-8"));
5959
}

src/http/headers/test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::fmt;
44
use headers::{HeaderConvertible, HeaderValueByteIterator};
55

66
pub fn from_stream_with_str<T: HeaderConvertible>(s: &str) -> Option<T> {
7-
let mut bytes = s.as_bytes().into_owned();
7+
let mut bytes = s.bytes().collect::<Vec<_>>();
88
bytes.push_all(bytes!("\r\n/"));
99
let mut reader = MemReader::new(bytes);
1010
let mut iter = HeaderValueByteIterator::new(&mut reader);

src/http/server/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl Request {
373373
match request.headers.content_length {
374374
Some(length) => {
375375
match buffer.read_exact(length) {
376-
Ok(body) => match str::from_utf8(body) {
376+
Ok(body) => match str::from_utf8(body.as_slice()) {
377377
Some(body_str) => request.body = body_str.to_owned(),
378378
None => return (request, Err(status::BadRequest))
379379
},

0 commit comments

Comments
 (0)