File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 14
14
Core encoding and decoding interfaces.
15
15
*/
16
16
17
+ use std:: path;
17
18
use std:: rc:: Rc ;
18
19
use std:: vec;
19
20
use std:: vec_ng:: Vec ;
@@ -625,6 +626,32 @@ impl<
625
626
}
626
627
}
627
628
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
+
628
655
// ___________________________________________________________________________
629
656
// Helper routines
630
657
//
You can’t perform that action at this time.
0 commit comments