mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 18:27:54 +00:00
Deserialize PathBuf from bytes
&Path already allows this. Also complete the tests for Path/PathBuf.
This commit is contained in:
@@ -889,11 +889,23 @@ declare_tests! {
|
||||
Path::new("/usr/local/lib") => &[
|
||||
Token::BorrowedStr("/usr/local/lib"),
|
||||
],
|
||||
Path::new("/usr/local/lib") => &[
|
||||
Token::BorrowedBytes(b"/usr/local/lib"),
|
||||
],
|
||||
}
|
||||
test_path_buf {
|
||||
PathBuf::from("/usr/local/lib") => &[
|
||||
Token::Str("/usr/local/lib"),
|
||||
],
|
||||
PathBuf::from("/usr/local/lib") => &[
|
||||
Token::String("/usr/local/lib"),
|
||||
],
|
||||
PathBuf::from("/usr/local/lib") => &[
|
||||
Token::Bytes(b"/usr/local/lib"),
|
||||
],
|
||||
PathBuf::from("/usr/local/lib") => &[
|
||||
Token::ByteBuf(b"/usr/local/lib"),
|
||||
],
|
||||
}
|
||||
test_cstring {
|
||||
CString::new("abc").unwrap() => &[
|
||||
|
||||
Reference in New Issue
Block a user