Support borrowed tokens in serde_test
This commit is contained in:
parent
cee3efbda8
commit
211e2bb8d9
@ -105,8 +105,10 @@ impl<'de, 'a, I> de::Deserializer<'de> for &'a mut Deserializer<I>
|
||||
Some(Token::F64(v)) => visitor.visit_f64(v),
|
||||
Some(Token::Char(v)) => visitor.visit_char(v),
|
||||
Some(Token::Str(v)) => visitor.visit_str(v),
|
||||
Some(Token::BorrowedStr(v)) => visitor.visit_borrowed_str(v),
|
||||
Some(Token::String(v)) => visitor.visit_string(v),
|
||||
Some(Token::Bytes(v)) => visitor.visit_bytes(v),
|
||||
Some(Token::BorrowedBytes(v)) => visitor.visit_borrowed_bytes(v),
|
||||
Some(Token::ByteBuf(v)) => visitor.visit_byte_buf(v),
|
||||
Some(Token::Option(false)) => visitor.visit_none(),
|
||||
Some(Token::Option(true)) => visitor.visit_some(self),
|
||||
|
@ -39,12 +39,18 @@ pub enum Token<'a> {
|
||||
/// A serialized `str`.
|
||||
Str(&'a str),
|
||||
|
||||
/// A borrowed `str`.
|
||||
BorrowedStr(&'a str),
|
||||
|
||||
/// A serialized `String`.
|
||||
String(String),
|
||||
|
||||
/// A serialized `[u8]`
|
||||
Bytes(&'a [u8]),
|
||||
|
||||
/// A borrowed `[u8]`.
|
||||
BorrowedBytes(&'a [u8]),
|
||||
|
||||
/// A serialized `ByteBuf`
|
||||
ByteBuf(Vec<u8>),
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user