Skip to content

Commit 8a2f493

Browse files
committed
Follow the latest changes up to 2014-03-23
related issues of mozilla/rust: - rust-lang/rust#12772 rename std::vec -> std::slice - rust-lang/rust#13028 rename std::vec_ng -> std::vec - rust-lang/rust@0305ed5d22e4 std: Add Vec to the prelude - rust-lang/rust#12907 std: Rename {push,read}_bytes to {push,read}_exact
1 parent 785e9b4 commit 8a2f493

File tree

13 files changed

+5
-23
lines changed

13 files changed

+5
-23
lines changed

src/examples/server/apache_fake/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
extern crate time;
88
extern crate http;
99

10-
use std::vec_ng::Vec;
11-
1210
use std::io::net::ip::{SocketAddr, Ipv4Addr};
1311
use std::io::Writer;
1412

src/examples/server/hello_world/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
extern crate time;
66
extern crate http;
77

8-
use std::vec_ng::Vec;
9-
108
use std::io::net::ip::{SocketAddr, Ipv4Addr};
119
use std::io::Writer;
1210

src/examples/server/info/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
extern crate time;
77
extern crate http;
88

9-
use std::vec_ng::Vec;
10-
119
use std::io::net::ip::{SocketAddr, Ipv4Addr};
1210
use std::io::Writer;
1311

src/examples/server/request_uri/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
extern crate time;
1010
extern crate http;
1111

12-
use std::vec_ng::Vec;
13-
1412
use std::io::net::ip::{SocketAddr, Ipv4Addr};
1513
use std::io::Writer;
1614

src/http/buffer.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
33
use std::io::{IoResult, Stream};
44
use std::cmp::min;
5-
use std::vec_ng::Vec;
6-
use std::vec;
5+
use std::slice;
76
use std::num::ToStrRadix;
87

98
// 64KB chunks (moderately arbitrary)
@@ -111,7 +110,7 @@ impl<T: Reader> Reader for BufferedStream<T> {
111110
try!(self.fill_buffer());
112111
}
113112
let size = min(self.read_max - self.read_pos, buf.len());
114-
vec::bytes::copy_memory(buf, self.read_buffer.slice_from(self.read_pos).slice_to(size));
113+
slice::bytes::copy_memory(buf, self.read_buffer.slice_from(self.read_pos).slice_to(size));
115114
self.read_pos += size;
116115
Ok(size)
117116
}

src/http/headers/accept_ranges.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! The Accept-Ranges request header, defined in RFC 2616, Section 14.5.
22
3-
use std::vec_ng::Vec;
43
use std::io::IoResult;
54
use std::ascii::StrAsciiExt;
65

src/http/headers/connection.rs

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl super::HeaderConvertible for Connection {
5858

5959
#[test]
6060
fn test_connection() {
61-
use std::vec_ng::Vec;
6261
use headers::test_utils::{assert_conversion_correct,
6362
assert_interpretation_correct,
6463
assert_invalid};

src/http/headers/content_type.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! The Content-Type entity header, defined in RFC 2616, Section 14.17.
22
use headers::serialization_utils::{push_parameters, WriterUtil};
3-
use std::vec_ng::Vec;
43
use std::io::IoResult;
54
use std::fmt;
65

src/http/headers/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! unknown headers are stored in a map in the traditional way.
66
77
use url::Url;
8-
use std::vec_ng::Vec;
98
use std::io::IoResult;
109
use time::{Tm, strptime};
1110
use rfc2616::{is_token_item, is_separator, CR, LF, SP, HT, COLON};
@@ -872,7 +871,6 @@ macro_rules! headers_mod {
872871
$attr;
873872
874873
#[allow(unused_imports)];
875-
use std::vec_ng::Vec;
876874
use std::io::IoResult;
877875
use time;
878876
use collections::treemap::{TreeMap, Entries};

src/http/headers/serialization_utils.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Utility functions for assisting with conversion of headers from and to the HTTP text form.
22
3-
use std::vec_ng::Vec;
4-
use std::vec;
3+
use std::slice;
54
use std::ascii::Ascii;
65
use std::io::IoResult;
76
use rfc2616::is_token;
@@ -23,7 +22,7 @@ use rfc2616::is_token;
2322
/// assert_eq!(normalise_header_name("FOO-BAR"), "Foo-Bar");
2423
/// ~~~
2524
pub fn normalise_header_name(name: &str) -> ~str {
26-
let mut result: ~[Ascii] = vec::with_capacity(name.len());
25+
let mut result: ~[Ascii] = slice::with_capacity(name.len());
2726
let mut capitalise = true;
2827
for c in name.chars() {
2928
let c = match capitalise {
@@ -217,7 +216,6 @@ pub fn push_parameters<K: Str, V: Str>(mut s: ~str, parameters: &[(K, V)]) -> ~s
217216

218217
#[cfg(test)]
219218
mod test {
220-
use std::vec_ng::Vec;
221219
use super::{normalise_header_name, comma_split, comma_split_iter, comma_join,
222220
push_quality, push_parameter, push_parameters,
223221
push_maybe_quoted_string, push_quoted_string, maybe_quoted_string, quoted_string,

src/http/headers/transfer_encoding.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-coding
44
5-
use std::vec_ng::Vec;
65
use std::ascii::StrAsciiExt;
76
use std::io::IoResult;
87
use headers::serialization_utils::{WriterUtil, push_parameters};

src/http/server/request.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl Request {
372372
// Read body if its length is specified
373373
match request.headers.content_length {
374374
Some(length) => {
375-
match buffer.read_bytes(length) {
375+
match buffer.read_exact(length) {
376376
Ok(body) => match str::from_utf8(body) {
377377
Some(body_str) => request.body = body_str.to_owned(),
378378
None => return (request, Err(status::BadRequest))

src/http/server/response.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::vec_ng::Vec;
21
use std::io::IoResult;
32
use std::io::net::tcp::TcpStream;
43

0 commit comments

Comments
 (0)