minghuaw / toy-rpc

An async RPC in rust-lang that mimics golang's net/rpc
29 stars 2 forks source link

Example `tide_integration`: compilation fails with "expected enum `tide_websockets::Error`, found enum `tungstenite::Error`" #34

Closed sveitser closed 2 years ago

sveitser commented 2 years ago

I get the following errors when running cargo check in the tide_integration crate.

error[E0308]: mismatched types
  --> /home/lulu/r/minghuaw/toy-rpc/toy-rpc/src/transport/ws/tide_ws.rs:65:17
   |
64 |             Err(err) => match err {
   |                               --- this expression has type `tide_websockets::Error`
65 |                 tungstenite::error::Error::Io(e) => Err(e),
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `tide_websockets::Error`, found enum `tungstenite::Error`
   |
   = note: perhaps two different versions of crate `tungstenite` are being used?

error[E0308]: mismatched types
  --> /home/lulu/r/minghuaw/toy-rpc/toy-rpc/src/transport/ws/tide_ws.rs:79:17
   |
78 |             match err {
   |                   --- this expression has type `tide_websockets::Error`
79 |                 tungstenite::Error::ConnectionClosed => {}
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `tide_websockets::Error`, found enum `tungstenite::Error`
   |
   = note: perhaps two different versions of crate `tungstenite` are being used?

For more information about this error, try `rustc --explain E0308`.
error: could not compile `toy-rpc` due to 2 previous errors

I'm using rust 1.62.0.

minghuaw commented 2 years ago

Thanks for the issue. I ll take a look at it later today or tomorrow. It's been really busy and I haven't got the time to keep up with all the dependencies

minghuaw commented 2 years ago

Hi, @sveitser the problem is actually simpler than I thought. tide-websocket has not been kept up to date with the latest tungstenite and I have a fork which I forgot to update the tungstenite version. The tide-integration should be good now with the updated deps in my fork.

You may need to run cargo update to update your Cargo.lock though.

I am going to work on updating other HTTP frameworks in the next following days and work on 0.9

sveitser commented 2 years ago

@minghuaw Thanks! The example compiles and runs just fine now.