-
Notifications
You must be signed in to change notification settings - Fork 31
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
Making the public API more familiar #106
Comments
Is moving the functions from module to impl potentially more ergonomic, because you can now call |
It will be based on the implementation of
|
Just for more information: we could technically add the new function and use a deprecated warning on the previous usage, right? |
We could do that, but I don't think it makes much sense in this case. There is already a list of breaking changes coming up for the next major version bump. Marking these functions deprecated in the next major version would simply require another major version bump before they could be completely removed. Aside from that, I personally don't feel marking functions as deprecated really does any good. For example, orion will fail to compile if any warnings are issued by the compiler, which will happen if one of its dependencies deprecates something (this happened with getrandom recently) and thereby break orion. So it'll depend on users whether deprecation is breaking or not. |
Gotcha! The approach sounds good to me. |
Fixed in #107. |
The public API for streaming structs and newtypes could be made more familiar to users that come from other Rust crypto libraries.
In continuation of trying to make the streaming API more consistent (#87) the general approach seems to be that all one-shot functions are also part of the struct (an example of this is the RustCrypto
Digest
trait). Maybe the current should be changed to:module::one_shot_function()
->module::Ctx::one_shot_function()
module::verify()
->module::Ctx::verify()
For the newtypes API, to be more consitent with types throughout Rust, we chould change:
get_length
->len
Changing the newtype API seems worthwhile, but it's debatable whether changing the straming struct API will make a noticable difference in usability.
The text was updated successfully, but these errors were encountered: