Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

upgrade to bytes 0.5 fails to compile #105

Closed
tomtau opened this issue Nov 26, 2019 · 0 comments · Fixed by #138
Closed

upgrade to bytes 0.5 fails to compile #105

tomtau opened this issue Nov 26, 2019 · 0 comments · Fixed by #138
Labels

Comments

@tomtau
Copy link
Contributor

tomtau commented Nov 26, 2019

error[E0053]: method `decode` has an incompatible type for trait
  --> src/codec.rs:23:5
   |
23 |     fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Request>, Box<dyn Error>> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bytes::bytes::BytesMut`, found struct `bytes::BytesMut`
   |
   = note: expected type `fn(&mut codec::ABCICodec, &mut bytes::bytes::BytesMut) -> std::result::Result<std::option::Option<messages::abci::Request>, std::boxed::Box<(dyn std::error::Error + 'static)>>`
              found type `fn(&mut codec::ABCICodec, &mut bytes::BytesMut) -> std::result::Result<std::option::Option<messages::abci::Request>, std::boxed::Box<(dyn std::error::Error + 'static)>>`

error[E0053]: method `encode` has an incompatible type for trait
  --> src/codec.rs:42:5
   |
42 |     fn encode(&mut self, msg: Response, buf: &mut BytesMut) -> Result<(), Box<dyn Error>> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bytes::bytes::BytesMut`, found struct `bytes::BytesMut`
   |
   = note: expected type `fn(&mut codec::ABCICodec, messages::abci::Response, &mut bytes::bytes::BytesMut) -> std::result::Result<(), std::boxed::Box<(dyn std::error::Error + 'static)>>`
              found type `fn(&mut codec::ABCICodec, messages::abci::Response, &mut bytes::BytesMut) -> std::result::Result<(), std::boxed::Box<(dyn std::error::Error + 'static)>>`

error[E0277]: the trait bound `&std::vec::Vec<u8>: bytes::Buf` is not satisfied
  --> src/codec.rs:52:17
   |
52 |         buf.put(&varint);
   |                 ^^^^^^^ the trait `bytes::Buf` is not implemented for `&std::vec::Vec<u8>`

error[E0599]: no method named `writer` found for type `&mut bytes::BytesMut` in the current scope
  --> src/codec.rs:53:38
   |
53 |         msg.write_to_writer(&mut buf.writer())?;
   |                                      ^^^^^^ help: there is a method with a similar name: `iter`
   |
   = help: items from traits can only be used if the trait is in scope
   = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
           `use crate::bytes::buf::BufMutExt;`

error: aborting due to 4 previous errors
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant