Tags: learnforpractice/bincode
Tags
Add necessary metadata to bincode_derive (bincode-org#420)
remove byteorder as a dependency (bincode-org#390) * remove byteorder as a dependency * fix module imports
Fix Deserializer::{from_slice, with_reader} types (bincode-org#332)
Having these in the impl block with a generic R paramter would make
them unusable, at least without type annotations:
error[E0282]: type annotations needed
--> msg_socket2/src/socket.rs:45:32
|
45 | let mut deserializer = Deserializer::with_reader(bytes.as_slice(), DefaultOptions::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `R`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.
Moving these into separate impl blocks, which set the type of the
Deserializer to the return type of the functions, fixes this error.
PreviousNext