Files
Natik GadzhiandCory Benfield f5773c171c feat: NIO.TimeAmount(string:) and TimeAmount.description (#3046)
Adds `TimeAmount.init(string:)` and `TimeAmount.description` for parsing
time amounts from strings and pretty printing them.

Closes #2504.

### Motivation:

Had a minute, wanted to work on Swift-NIO a bit more, and saw @weissi
still wanted this.

### Modifications:

It's largely based on the snippet @weissi made in #2504 with a few
changes:
- Added unit tests.
- Added support for more unit aliases for convenience based on
@glbrntt's suggestion.
- Changed `.gitignore` to ignore `.build` everywhere, I've got a few of
them when testing locally.


### Open questions:

- I originally thought perhaps I should add support for multiple number
and unit pairs, i.e. `1h 31m`, but decided against it. Feels like an
edge case. Happy to add this if you think it's needed.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2025-01-16 16:05:51 +00:00

16 lines
168 B
Plaintext

.DS_Store
.build
/.index-build
/Packages
/*.xcodeproj
Package.pins
*.pem
/docs/1.*
/docs/2.*
Package.resolved
.podspecs
DerivedData
.swiftpm
.*.sw?
.vscode/launch.json