Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

Using () as the default Message result type #18

Open
XX opened this issue Apr 24, 2020 · 1 comment
Open

Using () as the default Message result type #18

XX opened this issue Apr 24, 2020 · 1 comment

Comments

@XX
Copy link

XX commented Apr 24, 2020

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,
}
@robjtede
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants