Move base64 and hex from libextra to libserialize
This commit is contained in:
parent
7dc187afd8
commit
8a5b938b3b
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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]
|
||||
|
@ -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() {
|
@ -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() {
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user