mirror of https://git.sr.ht/~stygianentity/bincode
Update full slice syntax
This commit is contained in:
parent
883b1097ab
commit
a92429505a
|
|
@ -45,7 +45,7 @@ fn main() {
|
|||
// 8 bytes for the length of the vector, 4 bytes per float.
|
||||
assert_eq!(encoded.len(), 8 + 4 * 4);
|
||||
|
||||
let decoded: World = bincode::decode(&encoded[]).unwrap();
|
||||
let decoded: World = bincode::decode(&encoded[..]).unwrap();
|
||||
|
||||
assert!(world == decoded);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ mod refbox;
|
|||
///! let limit = bincode::SizeLimit::Bounded(20);
|
||||
///!
|
||||
///! let encoded: Vec<u8> = bincode::encode(&target, limit).unwrap();
|
||||
///! let decoded: Option<String> = bincode::decode(&encoded[]).unwrap();
|
||||
///! let decoded: Option<String> = bincode::decode(&encoded[..]).unwrap();
|
||||
///! assert_eq!(target, decoded);
|
||||
///! }
|
||||
///! ```
|
||||
|
|
|
|||
Loading…
Reference in New Issue