Skip to content

Commit e99fe7e

Browse files
committed
auto merge of #11912 : poiru/rust/8784-libuuid, r=alexcrichton
cc #8784
2 parents 346d378 + f8afc9a commit e99fe7e

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

mk/crates.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := std extra green rustuv native flate arena glob term semver
52+
TARGET_CRATES := std extra green rustuv native flate arena glob term semver uuid
5353
HOST_CRATES := syntax rustc rustdoc
5454
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5555
TOOLS := compiletest rustdoc rustc
@@ -67,6 +67,7 @@ DEPS_arena := std extra
6767
DEPS_glob := std
6868
DEPS_term := std
6969
DEPS_semver := std
70+
DEPS_uuid := std extra
7071

7172
TOOL_DEPS_compiletest := extra green rustuv
7273
TOOL_DEPS_rustdoc := rustdoc green rustuv

src/doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ li {list-style-type: none; }
4242
* [The `glob` file path matching library](glob/index.html)
4343
* [The `semver` version collation library](semver/index.html)
4444
* [The `term` terminal-handling library](term/index.html)
45+
* [The UUID library](uuid/index.html)
4546

4647
# Tooling
4748

src/libextra/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ pub mod rational;
8484
pub mod complex;
8585
pub mod stats;
8686
pub mod hex;
87-
pub mod uuid;
88-
8987

9088
#[cfg(unicode)]
9189
mod unicode;

src/libextra/uuid.rs renamed to src/libuuid/lib.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ unlikely.
2929
To create a new random (V4) UUID and print it out in hexadecimal form:
3030
3131
```rust
32-
extern mod extra;
33-
use extra::uuid::Uuid;
32+
use uuid::Uuid;
3433
3534
fn main() {
3635
let uuid1 = Uuid::new_v4();
@@ -55,6 +54,13 @@ Examples of string representations:
5554
5655
*/
5756

57+
#[crate_id = "uuid#0.10-pre"];
58+
#[crate_type = "rlib"];
59+
#[crate_type = "dylib"];
60+
#[license = "MIT/ASL2"];
61+
62+
extern mod extra;
63+
5864
use std::str;
5965
use std::vec;
6066
use std::num::FromStrRadix;
@@ -67,7 +73,7 @@ use std::cmp::Eq;
6773
use std::cast::{transmute,transmute_copy};
6874
use std::to_bytes::{IterBytes, Cb};
6975

70-
use serialize::{Encoder, Encodable, Decoder, Decodable};
76+
use extra::serialize::{Encoder, Encodable, Decoder, Decodable};
7177

7278
/// A 128-bit (16 byte) buffer containing the ID
7379
pub type UuidBytes = [u8, ..16];
@@ -510,7 +516,9 @@ impl rand::Rand for Uuid {
510516

511517
#[cfg(test)]
512518
mod test {
513-
use super::*;
519+
use super::{Uuid, VariantMicrosoft, VariantNCS, VariantRFC4122,
520+
Version1Mac, Version2Dce, Version3Md5, Version4Random,
521+
Version5Sha1};
514522
use std::str;
515523
use std::rand;
516524
use std::io::MemWriter;
@@ -575,6 +583,8 @@ mod test {
575583

576584
#[test]
577585
fn test_parse_uuid_v4() {
586+
use super::{ErrorInvalidCharacter, ErrorInvalidGroups,
587+
ErrorInvalidGroupLength, ErrorInvalidLength};
578588

579589
// Invalid
580590
assert!(Uuid::parse_string("").is_err());
@@ -774,8 +784,8 @@ mod test {
774784

775785
#[test]
776786
fn test_serialize_round_trip() {
777-
use ebml;
778-
use serialize::{Encodable, Decodable};
787+
use extra::ebml;
788+
use extra::serialize::{Encodable, Decodable};
779789

780790
let u = Uuid::new_v4();
781791
let mut wr = MemWriter::new();
@@ -799,8 +809,8 @@ mod test {
799809

800810
#[cfg(test)]
801811
mod bench {
802-
use super::*;
803-
use test::BenchHarness;
812+
use super::Uuid;
813+
use extra::test::BenchHarness;
804814

805815
#[bench]
806816
pub fn create_uuids(bh: &mut BenchHarness) {

0 commit comments

Comments
 (0)