Deserialize Box<Path> through PathBuf::into_boxed_path

Including Rc<Path> et al.

Fixes https://github.com/serde-rs/serde/issues/1633
This commit is contained in:
Jan Alexander Steffens (heftig) committed 2019-10-22 22:31:51 +02:00
1 parent 42990d8264
commit b8772a1e40
3 files changed
+19 -1

No files matched your search

+14
View File
@@ -907,6 +907,20 @@ declare_tests! {
Token::ByteBuf(b"/usr/local/lib"),
],
}
test_boxed_path {
PathBuf::from("/usr/local/lib").into_boxed_path() => &[
Token::Str("/usr/local/lib"),
],
PathBuf::from("/usr/local/lib").into_boxed_path() => &[
Token::String("/usr/local/lib"),
],
PathBuf::from("/usr/local/lib").into_boxed_path() => &[
Token::Bytes(b"/usr/local/lib"),
],
PathBuf::from("/usr/local/lib").into_boxed_path() => &[
Token::ByteBuf(b"/usr/local/lib"),
],
}
test_cstring {
CString::new("abc").unwrap() => &[
Token::Bytes(b"abc"),