Skip to content

Commit 8a5b938

Browse files
liigoalexcrichton
authored andcommitted
Move base64 and hex from libextra to libserialize
1 parent 7dc187a commit 8a5b938

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

src/libextra/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ pub mod url;
5959
pub mod json;
6060
pub mod tempfile;
6161
pub mod time;
62-
pub mod base64;
6362
pub mod workcache;
6463
pub mod enum_set;
6564
pub mod stats;
66-
pub mod hex;
6765

6866
#[cfg(unicode)]
6967
mod unicode;

src/librustc/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::run;
3434
use std::str;
3535
use std::io;
3636
use std::io::fs;
37-
use extra::hex::ToHex;
37+
use serialize::hex::ToHex;
3838
use extra::tempfile::TempDir;
3939
use syntax::abi;
4040
use syntax::ast;

src/librustc/util/sha2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::iter::range_step;
1616
use std::num::Zero;
1717
use std::vec;
1818
use std::vec::bytes::{MutableByteVector, copy_memory};
19-
use extra::hex::ToHex;
19+
use serialize::hex::ToHex;
2020

2121
/// Write a u32 into a vector, which must be 4 bytes long. The value is written in big-endian
2222
/// format.
@@ -529,7 +529,7 @@ mod tests {
529529
use std::vec;
530530
use std::rand::isaac::IsaacRng;
531531
use std::rand::Rng;
532-
use extra::hex::FromHex;
532+
use serialize::hex::FromHex;
533533

534534
// A normal addition - no overflow occurs
535535
#[test]

src/libextra/base64.rs renamed to src/libserialize/base64.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ impl<'a> ToBase64 for &'a [u8] {
6363
* # Example
6464
*
6565
* ```rust
66-
* extern mod extra;
67-
* use extra::base64::{ToBase64, STANDARD};
66+
* extern mod serialize;
67+
* use serialize::base64::{ToBase64, STANDARD};
6868
*
6969
* fn main () {
7070
* let str = [52,32].to_base64(STANDARD);
@@ -189,8 +189,8 @@ impl<'a> FromBase64 for &'a str {
189189
* This converts a string literal to base64 and back.
190190
*
191191
* ```rust
192-
* extern mod extra;
193-
* use extra::base64::{ToBase64, FromBase64, STANDARD};
192+
* extern mod serialize;
193+
* use serialize::base64::{ToBase64, FromBase64, STANDARD};
194194
* use std::str;
195195
*
196196
* fn main () {
@@ -261,8 +261,8 @@ impl<'a> FromBase64 for &'a str {
261261

262262
#[cfg(test)]
263263
mod test {
264-
use test::BenchHarness;
265-
use base64::*;
264+
use extra::test::BenchHarness;
265+
use base64::{Config, FromBase64, ToBase64, STANDARD, URL_SAFE};
266266

267267
#[test]
268268
fn test_to_base64_basic() {

src/libextra/hex.rs renamed to src/libserialize/hex.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ impl<'a> ToHex for &'a [u8] {
2828
* # Example
2929
*
3030
* ```rust
31-
* use extra::hex::ToHex;
31+
* extern mod serialize;
32+
* use serialize::hex::ToHex;
3233
*
3334
* fn main () {
3435
* let str = [52,32].to_hex();
@@ -88,7 +89,8 @@ impl<'a> FromHex for &'a str {
8889
* This converts a string literal to hexadecimal and back.
8990
*
9091
* ```rust
91-
* use extra::hex::{FromHex, ToHex};
92+
* extern mod serialize;
93+
* use serialize::hex::{FromHex, ToHex};
9294
* use std::str;
9395
*
9496
* fn main () {
@@ -137,8 +139,8 @@ impl<'a> FromHex for &'a str {
137139

138140
#[cfg(test)]
139141
mod tests {
140-
use test::BenchHarness;
141-
use hex::*;
142+
use extra::test::BenchHarness;
143+
use hex::{FromHex, ToHex};
142144

143145
#[test]
144146
pub fn test_to_hex() {

src/libserialize/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ pub use self::serialize::{Decoder, Encoder, Decodable, Encodable,
3030
DecoderHelpers, EncoderHelpers};
3131

3232
mod serialize;
33+
34+
pub mod base64;
3335
pub mod ebml;
36+
pub mod hex;
37+

0 commit comments

Comments
 (0)