Skip to content

Commit 244d772

Browse files
committed
Rust update: std::vec_ng->std::vec and std::vec->std::slice + removed unused imports
1 parent 785e9b4 commit 244d772

File tree

13 files changed

+16
-22
lines changed

13 files changed

+16
-22
lines changed

src/codegen/status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use collections::hashmap::HashSet;
1111
use std::ascii::StrAsciiExt;
12-
use std::vec;
12+
use std::slice;
1313
use std::io::IoResult;
1414
use super::get_writer;
1515

@@ -52,7 +52,7 @@ impl Status {
5252
/// "ImATeaPot"
5353
fn camel_case(msg: &str) -> ~str {
5454
let msg = msg.replace("-", " ").replace("'", "");
55-
let mut result: ~[Ascii] = vec::with_capacity(msg.len());
55+
let mut result: ~[Ascii] = slice::with_capacity(msg.len());
5656
let mut capitalise = true;
5757
for c in msg.chars() {
5858
let c = match capitalise {

src/examples/server/apache_fake/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern crate time;
88
extern crate http;
99

10-
use std::vec_ng::Vec;
10+
use std::vec::Vec;
1111

1212
use std::io::net::ip::{SocketAddr, Ipv4Addr};
1313
use std::io::Writer;

src/examples/server/hello_world/main.rs

Lines changed: 0 additions & 2 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
extern crate time;
1010
extern crate http;
1111

12-
use std::vec_ng::Vec;
12+
use std::vec::Vec;
1313

1414
use std::io::net::ip::{SocketAddr, Ipv4Addr};
1515
use std::io::Writer;

src/http/buffer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
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::vec::Vec;
6+
use std::slice;
77
use std::num::ToStrRadix;
88

99
// 64KB chunks (moderately arbitrary)
@@ -111,7 +111,7 @@ impl<T: Reader> Reader for BufferedStream<T> {
111111
try!(self.fill_buffer());
112112
}
113113
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));
114+
slice::bytes::copy_memory(buf, self.read_buffer.slice_from(self.read_pos).slice_to(size));
115115
self.read_pos += size;
116116
Ok(size)
117117
}

src/http/headers/accept_ranges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! The Accept-Ranges request header, defined in RFC 2616, Section 14.5.
22
3-
use std::vec_ng::Vec;
3+
use std::vec::Vec;
44
use std::io::IoResult;
55
use std::ascii::StrAsciiExt;
66

src/http/headers/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl super::HeaderConvertible for Connection {
5858

5959
#[test]
6060
fn test_connection() {
61-
use std::vec_ng::Vec;
61+
use std::vec::Vec;
6262
use headers::test_utils::{assert_conversion_correct,
6363
assert_interpretation_correct,
6464
assert_invalid};

src/http/headers/content_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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;
3+
use std::vec::Vec;
44
use std::io::IoResult;
55
use std::fmt;
66

src/http/headers/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! unknown headers are stored in a map in the traditional way.
66
77
use url::Url;
8-
use std::vec_ng::Vec;
8+
use std::vec::Vec;
99
use std::io::IoResult;
1010
use time::{Tm, strptime};
1111
use rfc2616::{is_token_item, is_separator, CR, LF, SP, HT, COLON};
@@ -872,7 +872,7 @@ macro_rules! headers_mod {
872872
$attr;
873873
874874
#[allow(unused_imports)];
875-
use std::vec_ng::Vec;
875+
use std::vec::Vec;
876876
use std::io::IoResult;
877877
use time;
878878
use collections::treemap::{TreeMap, Entries};

src/http/headers/serialization_utils.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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::vec::Vec;
4+
use std::slice;
55
use std::ascii::Ascii;
66
use std::io::IoResult;
77
use rfc2616::is_token;
@@ -23,7 +23,7 @@ use rfc2616::is_token;
2323
/// assert_eq!(normalise_header_name("FOO-BAR"), "Foo-Bar");
2424
/// ~~~
2525
pub fn normalise_header_name(name: &str) -> ~str {
26-
let mut result: ~[Ascii] = vec::with_capacity(name.len());
26+
let mut result: ~[Ascii] = slice::with_capacity(name.len());
2727
let mut capitalise = true;
2828
for c in name.chars() {
2929
let c = match capitalise {
@@ -217,7 +217,6 @@ pub fn push_parameters<K: Str, V: Str>(mut s: ~str, parameters: &[(K, V)]) -> ~s
217217

218218
#[cfg(test)]
219219
mod test {
220-
use std::vec_ng::Vec;
221220
use super::{normalise_header_name, comma_split, comma_split_iter, comma_join,
222221
push_quality, push_parameter, push_parameters,
223222
push_maybe_quoted_string, push_quoted_string, maybe_quoted_string, quoted_string,

src/http/headers/transfer_encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-coding
44
5-
use std::vec_ng::Vec;
5+
use std::vec::Vec;
66
use std::ascii::StrAsciiExt;
77
use std::io::IoResult;
88
use headers::serialization_utils::{WriterUtil, push_parameters};

src/http/server/response.rs

Lines changed: 0 additions & 1 deletion
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)