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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,13 @@ ecdsa!(ECDSA_P384_SHA512, "P-384 (secp384r1)", ecc::EC_GROUP_P384, "SHA-512",


/// EdDSA signatures.
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).


/// [Ed25519](http://ed25519.cr.yp.to/) signatures.
///
/// Ed25519 uses SHA-512 as the digest algorithm.
pub static ED25519: VerificationAlgorithm = VerificationAlgorithm {
implementation: &EdDSA {
_unused: 1,
}
implementation: &EdDSA,
};

#[cfg(test)]
Expand Down