Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move base64 and hex from libextra to libserialize #12200

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/libextra/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/util/sha2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions src/libextra/base64.rs → src/libserialize/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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() {
Expand Down
10 changes: 6 additions & 4 deletions src/libextra/hex.rs → src/libserialize/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions src/libserialize/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;