diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs index 70a21da6816..e0200f48cfe 100644 --- a/src/libextra/lib.rs +++ b/src/libextra/lib.rs @@ -59,11 +59,9 @@ pub mod url; pub mod json; pub mod tempfile; pub mod time; -pub mod base64; pub mod workcache; pub mod enum_set; pub mod stats; -pub mod hex; #[cfg(unicode)] mod unicode; diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 72ae70565a7..957ca3b46c9 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -34,7 +34,7 @@ use std::run; use std::str; use std::io; use std::io::fs; -use extra::hex::ToHex; +use serialize::hex::ToHex; use extra::tempfile::TempDir; use syntax::abi; use syntax::ast; diff --git a/src/librustc/util/sha2.rs b/src/librustc/util/sha2.rs index 116ec6bba29..940cebf7847 100644 --- a/src/librustc/util/sha2.rs +++ b/src/librustc/util/sha2.rs @@ -16,7 +16,7 @@ use std::iter::range_step; use std::num::Zero; use std::vec; use std::vec::bytes::{MutableByteVector, copy_memory}; -use extra::hex::ToHex; +use serialize::hex::ToHex; /// Write a u32 into a vector, which must be 4 bytes long. The value is written in big-endian /// format. @@ -529,7 +529,7 @@ mod tests { use std::vec; use std::rand::isaac::IsaacRng; use std::rand::Rng; - use extra::hex::FromHex; + use serialize::hex::FromHex; // A normal addition - no overflow occurs #[test] diff --git a/src/libextra/base64.rs b/src/libserialize/base64.rs similarity index 97% rename from src/libextra/base64.rs rename to src/libserialize/base64.rs index 556032af1ac..c22eefdb330 100644 --- a/src/libextra/base64.rs +++ b/src/libserialize/base64.rs @@ -63,8 +63,8 @@ impl<'a> ToBase64 for &'a [u8] { * # Example * * ```rust - * extern mod extra; - * use extra::base64::{ToBase64, STANDARD}; + * extern mod serialize; + * use serialize::base64::{ToBase64, STANDARD}; * * fn main () { * let str = [52,32].to_base64(STANDARD); @@ -189,8 +189,8 @@ impl<'a> FromBase64 for &'a str { * This converts a string literal to base64 and back. * * ```rust - * extern mod extra; - * use extra::base64::{ToBase64, FromBase64, STANDARD}; + * extern mod serialize; + * use serialize::base64::{ToBase64, FromBase64, STANDARD}; * use std::str; * * fn main () { @@ -261,8 +261,8 @@ impl<'a> FromBase64 for &'a str { #[cfg(test)] mod test { - use test::BenchHarness; - use base64::*; + use extra::test::BenchHarness; + use base64::{Config, FromBase64, ToBase64, STANDARD, URL_SAFE}; #[test] fn test_to_base64_basic() { diff --git a/src/libextra/hex.rs b/src/libserialize/hex.rs similarity index 96% rename from src/libextra/hex.rs rename to src/libserialize/hex.rs index d4e1ae12337..409bf4af809 100644 --- a/src/libextra/hex.rs +++ b/src/libserialize/hex.rs @@ -28,7 +28,8 @@ impl<'a> ToHex for &'a [u8] { * # Example * * ```rust - * use extra::hex::ToHex; + * extern mod serialize; + * use serialize::hex::ToHex; * * fn main () { * let str = [52,32].to_hex(); @@ -88,7 +89,8 @@ impl<'a> FromHex for &'a str { * This converts a string literal to hexadecimal and back. * * ```rust - * use extra::hex::{FromHex, ToHex}; + * extern mod serialize; + * use serialize::hex::{FromHex, ToHex}; * use std::str; * * fn main () { @@ -137,8 +139,8 @@ impl<'a> FromHex for &'a str { #[cfg(test)] mod tests { - use test::BenchHarness; - use hex::*; + use extra::test::BenchHarness; + use hex::{FromHex, ToHex}; #[test] pub fn test_to_hex() { diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 5f473b25369..3b71b2237b1 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -30,4 +30,8 @@ pub use self::serialize::{Decoder, Encoder, Decodable, Encodable, DecoderHelpers, EncoderHelpers}; mod serialize; + +pub mod base64; pub mod ebml; +pub mod hex; +