Skip to content

Commit 9a2ee0a

Browse files
committed
serialize: add missing Encodable impl for Path.
1 parent a19cf18 commit 9a2ee0a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libserialize/serialize.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,12 +764,18 @@ macro_rules! tuple {
764764

765765
tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
766766

767-
impl Encodable for path::PathBuf {
767+
impl Encodable for path::Path {
768768
fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> {
769769
self.to_str().unwrap().encode(e)
770770
}
771771
}
772772

773+
impl Encodable for path::PathBuf {
774+
fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> {
775+
path::Path::encode(self, e)
776+
}
777+
}
778+
773779
impl Decodable for path::PathBuf {
774780
fn decode<D: Decoder>(d: &mut D) -> Result<path::PathBuf, D::Error> {
775781
let bytes: String = Decodable::decode(d)?;

0 commit comments

Comments
 (0)