Skip to content

Commit 2b91836

Browse files
committed
---
yaml --- r: 105909 b: refs/heads/auto c: d2cfd54 h: refs/heads/master i: 105907: 9b11d7b v: v3
1 parent b8dd694 commit 2b91836

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
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: be12c9f753fa742dd76127a600ba9f2447d19b39
16+
refs/heads/auto: d2cfd543f764c4a3bab9149fe54233c4aa20e6d5
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libserialize/serialize.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Core encoding and decoding interfaces.
1515
*/
1616

17+
use std::path;
1718
use std::rc::Rc;
1819
use std::vec;
1920
use std::vec_ng::Vec;
@@ -625,6 +626,32 @@ impl<
625626
}
626627
}
627628

629+
impl<E: Encoder> Encodable<E> for path::posix::Path {
630+
fn encode(&self, e: &mut E) {
631+
self.as_vec().encode(e)
632+
}
633+
}
634+
635+
impl<D: Decoder> Decodable<D> for path::posix::Path {
636+
fn decode(d: &mut D) -> path::posix::Path {
637+
let bytes: ~[u8] = Decodable::decode(d);
638+
path::posix::Path::new(bytes)
639+
}
640+
}
641+
642+
impl<E: Encoder> Encodable<E> for path::windows::Path {
643+
fn encode(&self, e: &mut E) {
644+
self.as_vec().encode(e)
645+
}
646+
}
647+
648+
impl<D: Decoder> Decodable<D> for path::windows::Path {
649+
fn decode(d: &mut D) -> path::windows::Path {
650+
let bytes: ~[u8] = Decodable::decode(d);
651+
path::windows::Path::new(bytes)
652+
}
653+
}
654+
628655
// ___________________________________________________________________________
629656
// Helper routines
630657
//

0 commit comments

Comments
 (0)