mirror of
https://github.com/apple/swift-crypto
synced 2026-11-24 04:37:48 +00:00
`getKeyPrimitives` is marked as throws but is not actually throwing errors and this is yielding warnings. This fixes the warnings. ### Checklist - [x] I've run tests to see all new and existing tests pass - [x] I've followed the code style of the rest of the project - [x] I've read the [Contribution Guidelines](CONTRIBUTING.md) - [x] I've updated the documentation if necessary #### If you've made changes to `gyb` files - [N/A] I've run `./scripts/generate_boilerplate_files_with_gyb.sh` and included updated generated files in a commit of this pull request ### Motivation: Currently there's a warning ``` /swift-crypto/Sources/_CryptoExtras/RSA/RSA_boring.swift:67:9: warning: no calls to throwing functions occur within 'try' expression ``` because we're using `try` on a non throwing function. This escalates to all of the functions that use it. I'm not sure if removing `throws` from a non-actually-throwing public function is breaking, as using `try` on a non throwing function only yields a warning (if not in warnings-as-errors mode) but it actively is a signature change so it might still be breaking. In case we don't want to merge this as is, the warning can be removed by simply removing useless `try`s and we can wait for the next major version to remove the false-throwers. ### Modifications: Remove the useless `try` and `throws` where they're not needed. ### Result: The warning is gone.