Skip to content

Rust 2018 #13

@Byter09

Description

@Byter09

Hello.

I wanted to write a small tool to calculate something distributed on a master with slaves and learn more about Rust on the way. Having a simple transport layer with the help of protocol seemed like a good way. I'm using rustc 1.31.0 (abe02cefd 2018-12-04) and am currently getting this error:

error[E0107]: wrong number of type arguments: expected 0, found 2                                                                                                                                                                       
 --> src/network.rs:4:10                                                                                                                                                                                                                
  |                                                                                                                                                                                                                                     
4 | #[derive(Protocol, Debug, PartialEq)]                                                                                                                                                                                               
  |          ^^^^^^^^ 2 unexpected type arguments                                                                                                                                                                                       

I'm trying to use this on:

#[derive(Protocol, Debug, PartialEq)]
pub enum Message {
    RequestRegistration,
    Register(Registration),
    Job(Job),
    Result(Job, Result),
    RequestStatus,
    Status(Status),
}

Sadly the error is not very helpful in explaining what exactly I'm doing wrong but I highly suggest it has to do with Rust 2018, because the examples still use extern crate and #[macro_use]. Also there's no edition = "2018" in the Cargo.toml.

Any help on this is very appreciated. I don't think there's any other crate that can do what procotol suggests it can do this easily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions