Skip to content

Utilize 'unit struct' where appropriate. #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

frewsxcv
Copy link
Contributor

I agree to license my contributions to each file under the
same terms given at the top of each file I changed.

I agree to license my contributions to each file under the
same terms given at the top of each file I changed.
struct EdDSA {
_unused: u8, // XXX: Stable Rust doesn't allow empty structs.
}
struct EdDSA;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, this could be written:

struct EdDSA { }

...which was not stable in 1.0 (rust-lang/rfcs#218).

@briansmith
Copy link
Owner

Thanks! I was pretty sure that this didn't work before but I guess I was confiused. Committed as 9224062.

@briansmith briansmith closed this Feb 28, 2016
@frewsxcv frewsxcv deleted the empty-struct branch February 28, 2016 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants