You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make 'signature::KeyPair::public_key' a public function #741
It's already public because it is a trait method. Note that rustc will give you a confusing error message if you don't use ring::signature::KeyPair; in the module that you're trying to use it in, indicating that public_key is private. These types each have a private public_key field, and rustc is trying to be helpful by giving you a hint, but unfortunately its hint is the wrong one.
So, try adding use ring::signature::KeyPair; to the module you're having trouble in.
Note that the doc tests pass on my machine, as-is.
For reference, here is the error message I get when I remove the use ring::signature::KeyPair from the doctest:
---- src\signature.rs - signature (line 129) stdout ----
error[E0599]: no method named `public_key` found for type `ring::signature::KeyPair` in the current scope
--> src\signature.rs:153:38
|
26 | let peer_public_key_bytes = key_pair.public_key().as_ref();
| ^^^^^^^^^^ private field, not a method
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
3 | use ring::signature::KeyPair;
|
Activity
briansmith commentedon Dec 22, 2018
It's already public because it is a trait method. Note that rustc will give you a confusing error message if you don't
use ring::signature::KeyPair;in the module that you're trying to use it in, indicating thatpublic_keyis private. These types each have a privatepublic_keyfield, and rustc is trying to be helpful by giving you a hint, but unfortunately its hint is the wrong one.So, try adding
use ring::signature::KeyPair;to the module you're having trouble in.Note that the doc tests pass on my machine, as-is.
briansmith commentedon Dec 22, 2018
For reference, here is the error message I get when I remove the
use ring::signature::KeyPairfrom the doctest:manifest commentedon Dec 22, 2018
Yes, my fault. Thanks a lot 👍