فهرست منبع

Update to rust with opt-in Copy

by adding explicit `Copy` impls for the exported types `SchemeType` and
`EncodeSet`, and also to `EncodingOverride`. This fixes the build for
rustc bc486dc23 2014-12-10.
Benjamin Herr 11 سال پیش
والد
کامیت
1d37cd9818
3فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 2 0
      src/encoding.rs
  2. 1 1
      src/lib.rs
  3. 1 0
      src/percent_encoding.rs

+ 2 - 0
src/encoding.rs

@@ -19,6 +19,7 @@ use std::borrow::Cow;
 #[cfg(feature = "query_encoding")] pub use self::encoding::types::EncodingRef;
 
 #[cfg(feature = "query_encoding")]
+#[deriving(Copy)]
 pub struct EncodingOverride {
     /// `None` means UTF-8.
     encoding: Option<EncodingRef>
@@ -68,6 +69,7 @@ impl EncodingOverride {
 
 
 #[cfg(not(feature = "query_encoding"))]
+#[deriving(Copy)]
 pub struct EncodingOverride;
 
 #[cfg(not(feature = "query_encoding"))]

+ 1 - 1
src/lib.rs

@@ -412,7 +412,7 @@ impl<'a> UrlParser<'a> {
 
 
 /// Determines the behavior of the URL parser for a given scheme.
-#[deriving(PartialEq, Eq)]
+#[deriving(PartialEq, Eq, Copy)]
 pub enum SchemeType {
     /// Indicate that the scheme is *non-relative*.
     ///

+ 1 - 0
src/percent_encoding.rs

@@ -27,6 +27,7 @@ mod encode_sets;
 /// If you need a different encode set,
 /// please [file a bug](https://github.com/servo/rust-url/issues)
 /// explaining the use case.
+#[deriving(Copy)]
 pub struct EncodeSet {
     map: &'static [&'static str, ..256],
 }