Skip to content

Commit

Permalink
fix(rustup): Extend now takes an IntoIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
renato-zannon authored and seanmonstar committed Feb 21, 2015
1 parent 1904c45 commit 598d8f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::str::from_utf8;
use std::string::CowString;
use std::collections::HashMap;
use std::collections::hash_map::{Iter, Entry};
use std::iter::FromIterator;
use std::iter::{FromIterator, IntoIterator};
use std::borrow::IntoCow;
use std::{mem, raw};

Expand Down Expand Up @@ -351,15 +351,15 @@ impl<'a> fmt::Debug for HeaderView<'a> {
}

impl<'a> Extend<HeaderView<'a>> for Headers {
fn extend<I: Iterator<Item=HeaderView<'a>>>(&mut self, iter: I) {
fn extend<I: IntoIterator<Item=HeaderView<'a>>>(&mut self, iter: I) {
for header in iter {
self.data.insert((*header.0).clone(), (*header.1).clone());
}
}
}

impl<'a> FromIterator<HeaderView<'a>> for Headers {
fn from_iter<I: Iterator<Item=HeaderView<'a>>>(iter: I) -> Headers {
fn from_iter<I: IntoIterator<Item=HeaderView<'a>>>(iter: I) -> Headers {
let mut headers = Headers::new();
headers.extend(iter);
headers
Expand Down

0 comments on commit 598d8f9

Please sign in to comment.