actix-derive icon indicating copy to clipboard operation
actix-derive copied to clipboard

Using `()` as the default Message result type

Open XX opened this issue 4 years ago • 1 comments

What about using () as the default result type? Currently I need to use a lot of boilerplate code with the rtype attribute, like this:

#[derive(Message, Debug)]
#[rtype(result = "()")]
pub struct SomeMessage {
    pub name: String,
}

XX avatar Apr 24 '20 12:04 XX

There's an argument that using a default value and allowing the [rtype=...] attribute to be omitted would make code less obvious, especially if Message is hidden in a bigger list of derives.

robjtede avatar Apr 24 '20 15:04 robjtede