parent
c1395ea588
commit
f8afc9a5c1
4 changed files with 21 additions and 11 deletions
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -84,8 +84,6 @@ pub mod rational;
|
|||
pub mod complex;
|
||||
pub mod stats;
|
||||
pub mod hex;
|
||||
pub mod uuid;
|
||||
|
||||
|
||||
#[cfg(unicode)]
|
||||
mod unicode;
|
||||
|
|
|
@ -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) {
|
Loading…
Add table
Reference in a new issue