Browse Source

Small fixes to value_codec.rs.

wip
Titouan Rigoudy 4 years ago
parent
commit
f153167e1d
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/proto/value_codec.rs

+ 2
- 1
src/proto/value_codec.rs View File

@ -191,6 +191,7 @@ impl<'a> ValueDecoder<'a> {
Ok(decode_u32(array)) Ok(decode_u32(array))
} }
/// Attempts to decode a u16 value.
fn decode_u16(&mut self) -> Result<u16, ValueDecodeError> { fn decode_u16(&mut self) -> Result<u16, ValueDecodeError> {
let position = self.position; let position = self.position;
let n = self.decode_u32()?; let n = self.decode_u32()?;
@ -422,7 +423,7 @@ impl ValueEncode for net::Ipv4Addr {
// `core::convert::AsRef<str>` for type `bool` in future versions". // `core::convert::AsRef<str>` for type `bool` in future versions".
// We could probably work around this with more complex type logic (e.g. // We could probably work around this with more complex type logic (e.g.
// wrapping primitive types in a newtype for which we implement // wrapping primitive types in a newtype for which we implement
// Proto{De,En}code) but it is not really worth the hassle.
// Value{De,En}code) but it is not really worth the hassle.
impl ValueEncode for str { impl ValueEncode for str {
fn encode(&self, encoder: &mut ValueEncoder) -> Result<(), ValueEncodeError> { fn encode(&self, encoder: &mut ValueEncoder) -> Result<(), ValueEncodeError> {


Loading…
Cancel
Save