-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conversions between
Swift.Duration
and `Google_Protobuf_Duratio…
…n`. (#1745) I saw one of our teams recently add this extension to their code base and it makes sense to have it here. Instead of just calling libc's `round` internally like some of the other precision-lowering conversions, I decided to make the `Duration`-to-protobuf conversion more flexible by taking a `FloatingPointRoundingRule` and having it default to standard "school room" rounding. It might be a good idea to update the other precision-lowering conversions to match (deprecating and/or defaulting the old versions as appropriate).
- Loading branch information
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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