Эх сурвалжийг харах

Upgrade to rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)

Simon Sapin 11 жил өмнө
parent
commit
6d7f6cd540
3 өөрчлөгдсөн 8 нэмэгдсэн , 6 устгасан
  1. 3 3
      src/form_urlencoded.rs
  2. 2 2
      src/lib.rs
  3. 3 1
      src/parser.rs

+ 3 - 3
src/form_urlencoded.rs

@@ -98,7 +98,7 @@ pub fn serialize_owned(pairs: &[(String, String)]) -> String {
 /// Convert an iterator of (name, value) pairs
 /// into a string in the `application/x-www-form-urlencoded` format.
 #[inline]
-pub fn serialize<'a, I>(pairs: I) -> String where I: Iterator<(&'a str, &'a str)> {
+pub fn serialize<'a, I>(pairs: I) -> String where I: Iterator<Item = (&'a str, &'a str)> {
     serialize_internal(pairs, EncodingOverride::utf8())
 }
 
@@ -115,12 +115,12 @@ pub fn serialize<'a, I>(pairs: I) -> String where I: Iterator<(&'a str, &'a str)
 #[inline]
 pub fn serialize_with_encoding<'a, I>(pairs: I, encoding_override: Option<::encoding::EncodingRef>)
                                       -> String
-                                      where I: Iterator<(&'a str, &'a str)> {
+                                      where I: Iterator<Item = (&'a str, &'a str)> {
     serialize_internal(pairs, EncodingOverride::from_opt_encoding(encoding_override))
 }
 
 fn serialize_internal<'a, I>(mut pairs: I, encoding_override: EncodingOverride) -> String
-                             where I: Iterator<(&'a str, &'a str)> {
+                             where I: Iterator<Item = (&'a str, &'a str)> {
     #[inline]
     fn byte_serialize(input: &str, output: &mut String,
                       encoding_override: EncodingOverride) {

+ 2 - 2
src/lib.rs

@@ -119,7 +119,7 @@ assert!(css_url.serialize() == "http://servo.github.io/rust-url/main.css".to_str
 */
 
 
-#![feature(macro_rules, default_type_params, old_orphan_check)]
+#![feature(macro_rules, default_type_params, old_orphan_check, associated_types)]
 
 extern crate "rustc-serialize" as rustc_serialize;
 
@@ -726,7 +726,7 @@ impl Url {
     /// Serialize an iterator of (key, value) pairs as `application/x-www-form-urlencoded`
     /// and set it as the URL’s query string.
     #[inline]
-    pub fn set_query_from_pairs<'a, I: Iterator<(&'a str, &'a str)>>(&mut self, pairs: I) {
+    pub fn set_query_from_pairs<'a, I: Iterator<Item = (&'a str, &'a str)>>(&mut self, pairs: I) {
         self.query = Some(form_urlencoded::serialize(pairs));
     }
 

+ 3 - 1
src/parser.rs

@@ -735,7 +735,9 @@ pub struct CharRanges<'a> {
     position: uint,
 }
 
-impl<'a> Iterator<(uint, char, uint)> for CharRanges<'a> {
+impl<'a> Iterator for CharRanges<'a> {
+    type Item = (uint, char, uint);
+
     #[inline]
     fn next(&mut self) -> Option<(uint, char, uint)> {
         if self.position == self.slice.len() {