Move base64 and hex from libextra to libserialize

This commit is contained in:
Liigo Zhuang 2014-02-12 08:40:52 +08:00 committed by Alex Crichton
parent 7dc187afd8
commit 8a5b938b3b
6 changed files with 19 additions and 15 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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]

View File

@ -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() {

View File

@ -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() {

View File

@ -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;