Skip to content

Commit 4f1c432

Browse files
committed
---
yaml --- r: 83163 b: refs/heads/auto c: 88acb73 h: refs/heads/master i: 83161: 0685cd1 83159: abdf67b v: v3
1 parent fba7887 commit 4f1c432

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 256913eb328027cb098aea0f231cc0e245f56714
16+
refs/heads/auto: 88acb73ce5a98e707ce68f5c0579641de38b5955
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/target.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export CFG_COMPILER_TRIPLE
1515

1616
# The standard libraries should be held up to a higher standard than any old
1717
# code, make sure that these common warnings are denied by default. These can
18-
# be overridden during development temporarily. For stage0, we allow all these
19-
# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
20-
WFLAGS_ST0 = -A warnings
18+
# be overridden during development temporarily. For stage0, we allow warnings
19+
# which may be bugs in stage0 (should be fixed in stage1+)
20+
WFLAGS_ST0 = -W warnings
2121
WFLAGS_ST1 = -D warnings
2222
WFLAGS_ST2 = -D warnings
2323

branches/auto/src/libextra/uuid.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ use std::rand::Rng;
6666
use std::cmp::Eq;
6767
use std::cast::{transmute,transmute_copy};
6868

69+
use serialize::{Encoder, Encodable, Decoder, Decodable};
70+
6971
/// A 128-bit (16 byte) buffer containing the ID
7072
pub type UuidBytes = [u8, ..16];
7173

@@ -486,6 +488,21 @@ impl TotalEq for Uuid {
486488
}
487489
}
488490

491+
// FIXME #9845: Test these more thoroughly
492+
impl<T: Encoder> Encodable<T> for Uuid {
493+
/// Encode a UUID as a hypenated string
494+
fn encode(&self, e: &mut T) {
495+
e.emit_str(self.to_hyphenated_str());
496+
}
497+
}
498+
499+
impl<T: Decoder> Decodable<T> for Uuid {
500+
/// Decode a UUID from a string
501+
fn decode(d: &mut T) -> Uuid {
502+
from_str(d.read_str()).unwrap()
503+
}
504+
}
505+
489506
/// Generates a random instance of UUID (V4 conformant)
490507
impl rand::Rand for Uuid {
491508
#[inline]
@@ -770,6 +787,20 @@ mod test {
770787
assert!(ub.len() == 16);
771788
assert!(! ub.iter().all(|&b| b == 0));
772789
}
790+
791+
#[test]
792+
fn test_serialize_round_trip() {
793+
use std;
794+
use ebml;
795+
use serialize::{Encodable, Decodable};
796+
797+
let u = Uuid::new_v4();
798+
let bytes = do std::io::with_bytes_writer |wr| {
799+
u.encode(&mut ebml::writer::Encoder(wr));
800+
};
801+
let u2 = Decodable::decode(&mut ebml::reader::Decoder(ebml::reader::Doc(@bytes)));
802+
assert_eq!(u, u2);
803+
}
773804
}
774805

775806
#[cfg(test)]

branches/auto/src/libstd/num/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ impl_from_primitive!(f64, n.to_f64())
861861
/// # Example
862862
///
863863
/// ```
864-
/// let twenty: f32 = num::cast(0x14).unwrap();
864+
/// let twenty: f32 = num::cast(0x14);
865865
/// assert_eq!(twenty, 20f32);
866866
/// ```
867867
///

0 commit comments

Comments
 (0)