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)
2019-10-22 22:29:30 +02:00
parent 42990d8264
commit b8772a1e40
3 changed files with 19 additions and 1 deletions
+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"),