Преглед изворни кода

Merge commit 'refs/pull/510/head' of github.com:servo/rust-url into 2.0

Simon Sapin пре 7 година
родитељ
комит
54d8b3fbf1
9 измењених фајлова са 4 додато и 16 уклоњено
  1. 2 3
      .travis.yml
  2. 0 2
      idna/src/punycode.rs
  3. 0 2
      idna/src/uts46.rs
  4. 0 1
      percent_encoding/lib.rs
  5. 0 1
      src/form_urlencoded.rs
  6. 0 1
      src/lib.rs
  7. 2 2
      src/origin.rs
  8. 0 3
      src/parser.rs
  9. 0 1
      tests/unit.rs

+ 2 - 3
.travis.yml

@@ -2,7 +2,7 @@ language: rust
 
 jobs:
   include:
-  - rust: 1.17.0
+  - rust: 1.24.0
     install:
     # --precise requires Cargo.lock to already exist
     - cargo update
@@ -11,8 +11,7 @@ jobs:
 
     - cargo update -p unicode-normalization --precise 0.1.5
 
-    # data-url uses pub(crate) which is unstable in 1.17
-    script: cargo test --all-features -p url -p idna -p percent-encoding -p url_serde
+    script: cargo test --all-features -p url -p idna -p percent-encoding -p url_serde -p data-url
 
   - rust: stable
     script: cargo test --all-features --all

+ 0 - 2
idna/src/punycode.rs

@@ -15,8 +15,6 @@
 
 use std::u32;
 use std::char;
-#[allow(unused_imports, deprecated)]
-use std::ascii::AsciiExt;
 
 // Bootstring parameters for Punycode
 static BASE: u32 = 36;

+ 0 - 2
idna/src/uts46.rs

@@ -11,8 +11,6 @@
 
 use self::Mapping::*;
 use punycode;
-#[allow(unused_imports, deprecated)]
-use std::ascii::AsciiExt;
 use std::cmp::Ordering::{Equal, Less, Greater};
 use unicode_bidi::{BidiClass, bidi_class};
 use unicode_normalization::UnicodeNormalization;

+ 0 - 1
percent_encoding/lib.rs

@@ -32,7 +32,6 @@
 //! assert_eq!(utf8_percent_encode("foo bar?", DEFAULT_ENCODE_SET).to_string(), "foo%20bar%3F");
 //! ```
 
-use std::ascii::AsciiExt;
 use std::borrow::Cow;
 use std::fmt;
 use std::slice;

+ 0 - 1
src/form_urlencoded.rs

@@ -55,7 +55,6 @@ pub fn parse_with_encoding<'a>(input: &'a [u8],
                                encoding_override: Option<::encoding::EncodingRef>,
                                use_charset: bool)
                                -> Result<Parse<'a>, ()> {
-    use std::ascii::AsciiExt;
 
     let mut encoding = EncodingOverride::from_opt_encoding(encoding_override);
     if !(encoding.is_utf8() || input.is_ascii()) {

+ 0 - 1
src/lib.rs

@@ -2332,7 +2332,6 @@ fn path_to_file_url_segments_windows(path: &Path, serialization: &mut String)
 fn file_url_segments_to_pathbuf(host: Option<&str>, segments: str::Split<char>) -> Result<PathBuf, ()> {
     use std::ffi::OsStr;
     use std::os::unix::prelude::OsStrExt;
-    use std::path::PathBuf;
 
     if host.is_some() {
         return Err(());

+ 2 - 2
src/origin.rs

@@ -10,7 +10,7 @@
 use host::Host;
 use idna::domain_to_unicode;
 use parser::default_port;
-use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
+use std::sync::atomic::{AtomicUsize, Ordering};
 use Url;
 
 pub fn url_origin(url: &Url) -> Origin {
@@ -76,7 +76,7 @@ impl HeapSizeOf for Origin {
 impl Origin {
     /// Creates a new opaque origin that is only equal to itself.
     pub fn new_opaque() -> Origin {
-        static COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
+        static COUNTER: AtomicUsize = AtomicUsize::new(0);
         Origin::Opaque(OpaqueOrigin(COUNTER.fetch_add(1, Ordering::SeqCst)))
     }
 

+ 0 - 3
src/parser.rs

@@ -6,9 +6,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[allow(unused_imports, deprecated)]
-use std::ascii::AsciiExt;
-
 use std::error::Error;
 use std::fmt::{self, Formatter, Write};
 use std::str;

+ 0 - 1
tests/unit.rs

@@ -11,7 +11,6 @@
 #[macro_use]
 extern crate url;
 
-use std::ascii::AsciiExt;
 use std::borrow::Cow;
 use std::cell::{Cell, RefCell};
 use std::net::{Ipv4Addr, Ipv6Addr};