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 1414Core encoding and decoding interfaces.
1515*/
1616
17+ use std:: path;
1718use std:: rc:: Rc ;
1819use std:: vec;
1920use 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//
You can’t perform that action at this time.
0 commit comments