Skip to content

extra: Move uuid to libuuid #11912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# automatically generated for all stage/host/target combinations.
################################################################################

TARGET_CRATES := std extra green rustuv native flate arena glob term semver
TARGET_CRATES := std extra green rustuv native flate arena glob term semver uuid
HOST_CRATES := syntax rustc rustdoc
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
TOOLS := compiletest rustdoc rustc
Expand All @@ -67,6 +67,7 @@ DEPS_arena := std extra
DEPS_glob := std
DEPS_term := std
DEPS_semver := std
DEPS_uuid := std extra

TOOL_DEPS_compiletest := extra green rustuv
TOOL_DEPS_rustdoc := rustdoc green rustuv
Expand Down
1 change: 1 addition & 0 deletions src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions src/libextra/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ pub mod rational;
pub mod complex;
pub mod stats;
pub mod hex;
pub mod uuid;


#[cfg(unicode)]
mod unicode;
Expand Down
26 changes: 18 additions & 8 deletions src/libextra/uuid.rs → src/libuuid/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand All @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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();
Expand All @@ -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) {
Expand Down