Skip to content

Commit

Permalink
fix(rustup): str.split and associated type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
globin committed Feb 27, 2015
1 parent 9998417 commit 1b6e6a0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/header/common/accept_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct Language{
impl FromStr for Language {
type Err = ();
fn from_str(s: &str) -> Result<Language, ()> {
let mut i = s.split_str("-");
let mut i = s.split("-");
let p = i.next();
let s = i.next();
match (p, s) {
Expand Down
2 changes: 1 addition & 1 deletion src/header/common/transfer_encoding.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use header::{self, Encoding};
use header::Encoding;

/// The `Transfer-Encoding` header.
///
Expand Down
2 changes: 1 addition & 1 deletion src/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ mod tests {

let s = headers.to_string();
// hashmap's iterators have arbitrary order, so we must sort first
let mut pieces = s.split_str("\r\n").collect::<Vec<&str>>();
let mut pieces = s.split("\r\n").collect::<Vec<&str>>();
pieces.sort();
let s = pieces.into_iter().rev().collect::<Vec<&str>>().connect("\r\n");
assert_eq!(s, "Host: foo.bar\r\nContent-Length: 15\r\n");
Expand Down
3 changes: 3 additions & 0 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ pub struct Streaming;

/// An abstraction to listen for connections on a certain port.
pub trait NetworkListener {
/// Type of Acceptor
type Acceptor: NetworkAcceptor;
/// Listens on a socket.
fn listen<To: ToSocketAddr>(&mut self, addr: To) -> IoResult<Self::Acceptor>;
}

/// An abstraction to receive `NetworkStream`s.
pub trait NetworkAcceptor: Clone + Send {
/// Type of Stream to receive
type Stream: NetworkStream + Send + Clone;

/// Returns an iterator of streams.
Expand Down Expand Up @@ -89,6 +91,7 @@ impl<T: NetworkStream + Send + Clone> StreamClone for T {

/// A connector creates a NetworkStream.
pub trait NetworkConnector {
/// Type of Stream to create
type Stream: NetworkStream + Send;
/// Connect to a remote address.
fn connect(&mut self, host: &str, port: Port, scheme: &str) -> IoResult<Self::Stream>;
Expand Down

0 comments on commit 1b6e6a0

Please sign in to comment.