diff options
| author | bors <bors@rust-lang.org> | 2014-02-03 21:21:32 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-02-03 21:21:32 -0800 |
| commit | e99fe7e4b99b02ac3d3e8d4f52e27603befff8a5 (patch) | |
| tree | 2c1fc7a75e0cadaf3f219a4266715861d8464c95 /src | |
| parent | 346d378ad58ec32ad2eb500af1613a53b95bf143 (diff) | |
| parent | f8afc9a5c1db0467b58c0fd5b6f8533145f2fc85 (diff) | |
| download | rust-e99fe7e4b99b02ac3d3e8d4f52e27603befff8a5.tar.gz rust-e99fe7e4b99b02ac3d3e8d4f52e27603befff8a5.zip | |
auto merge of #11912 : poiru/rust/8784-libuuid, r=alexcrichton
cc #8784
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/index.md | 1 | ||||
| -rw-r--r-- | src/libextra/lib.rs | 2 | ||||
| -rw-r--r-- | src/libuuid/lib.rs (renamed from src/libextra/uuid.rs) | 26 |
3 files changed, 19 insertions, 10 deletions
diff --git a/src/doc/index.md b/src/doc/index.md index a639ca16f35..9915d67bfca 100644 --- a/src/doc/index.md +++ b/src/doc/index.md @@ -42,6 +42,7 @@ li {list-style-type: none; } * [The `glob` file path matching library](glob/index.html) * [The `semver` version collation library](semver/index.html) * [The `term` terminal-handling library](term/index.html) +* [The UUID library](uuid/index.html) # Tooling diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs index 2c417026065..96413f82729 100644 --- a/src/libextra/lib.rs +++ b/src/libextra/lib.rs @@ -84,8 +84,6 @@ pub mod rational; pub mod complex; pub mod stats; pub mod hex; -pub mod uuid; - #[cfg(unicode)] mod unicode; diff --git a/src/libextra/uuid.rs b/src/libuuid/lib.rs index 29d3066b2f5..60e69af324e 100644 --- a/src/libextra/uuid.rs +++ b/src/libuuid/lib.rs @@ -29,8 +29,7 @@ unlikely. To create a new random (V4) UUID and print it out in hexadecimal form: ```rust -extern mod extra; -use extra::uuid::Uuid; +use uuid::Uuid; fn main() { let uuid1 = Uuid::new_v4(); @@ -55,6 +54,13 @@ Examples of string representations: */ +#[crate_id = "uuid#0.10-pre"]; +#[crate_type = "rlib"]; +#[crate_type = "dylib"]; +#[license = "MIT/ASL2"]; + +extern mod extra; + use std::str; use std::vec; use std::num::FromStrRadix; @@ -67,7 +73,7 @@ use std::cmp::Eq; use std::cast::{transmute,transmute_copy}; use std::to_bytes::{IterBytes, Cb}; -use serialize::{Encoder, Encodable, Decoder, Decodable}; +use extra::serialize::{Encoder, Encodable, Decoder, Decodable}; /// A 128-bit (16 byte) buffer containing the ID pub type UuidBytes = [u8, ..16]; @@ -510,7 +516,9 @@ impl rand::Rand for Uuid { #[cfg(test)] mod test { - use super::*; + use super::{Uuid, VariantMicrosoft, VariantNCS, VariantRFC4122, + Version1Mac, Version2Dce, Version3Md5, Version4Random, + Version5Sha1}; use std::str; use std::rand; use std::io::MemWriter; @@ -575,6 +583,8 @@ mod test { #[test] fn test_parse_uuid_v4() { + use super::{ErrorInvalidCharacter, ErrorInvalidGroups, + ErrorInvalidGroupLength, ErrorInvalidLength}; // Invalid assert!(Uuid::parse_string("").is_err()); @@ -774,8 +784,8 @@ mod test { #[test] fn test_serialize_round_trip() { - use ebml; - use serialize::{Encodable, Decodable}; + use extra::ebml; + use extra::serialize::{Encodable, Decodable}; let u = Uuid::new_v4(); let mut wr = MemWriter::new(); @@ -799,8 +809,8 @@ mod test { #[cfg(test)] mod bench { - use super::*; - use test::BenchHarness; + use super::Uuid; + use extra::test::BenchHarness; #[bench] pub fn create_uuids(bh: &mut BenchHarness) { |
