Merged
Conversation
Lukasa
reviewed
Sep 19, 2025
Sources/_CryptoExtras/RSA/RSA.swift
Outdated
|
|
||
| public func getKeyPrimitives() throws -> Primitives { | ||
| let (n, e) = try self.backing.getKeyPrimitives() | ||
| public func getKeyPrimitives() -> Primitives { |
Contributor
There was a problem hiding this comment.
Let's leave the throws on the public functions and just remove the incorrect internal trys.
throws to fix warningstry to fix warnings
Lukasa
approved these changes
Sep 22, 2025
Contributor
|
Thanks @ptoffy! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getKeyPrimitivesis marked as throws but is not actually throwing errors and this is yielding warnings. This fixes the warnings.Checklist
If you've made changes to
gybfiles./scripts/generate_boilerplate_files_with_gyb.shand included updated generated files in a commit of this pull requestMotivation:
Currently there's a warning
because we're using
tryon a non throwing function. This escalates to all of the functions that use it.I'm not sure if removing
throwsfrom a non-actually-throwing public function is breaking, as usingtryon 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 uselesstrys and we can wait for the next major version to remove the false-throwers.Modifications:
Remove the useless
tryandthrowswhere they're not needed.Result:
The warning is gone.