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

Prefer variant structs over variant tuples #6

Closed
jonhoo opened this issue Nov 3, 2017 · 1 comment
Closed

Prefer variant structs over variant tuples #6

jonhoo opened this issue Nov 3, 2017 · 1 comment

Comments

@jonhoo
Copy link

jonhoo commented Nov 3, 2017

In a couple of places, enum variant tuples are used (e.g. MailboxDatum::List). It might be better if these were variant structs instead, so that their contents become self-documenting. For example, compare:

pub enum MailboxDatum<'a> {
    // ...
    List(Vec<&'a str>, &'a str, &'a str),
    // ...
}

with

pub enum MailboxDatum<'a> {
    // ...
    List {
        flags: Vec<&'a str>,
        delimiter: &'a str,
        name: &'a str
    },
    // ...
}
@djc djc closed this as completed in 5ba568a Nov 4, 2017
@djc
Copy link
Owner

djc commented Nov 4, 2017

Good point, done!

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