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.
Changes
ByteUnit
/CoreUnit
/TimeUnit
now useu64
instead ofi64
. It makes no sense to store them as signed, especially because parsing negative units always results in error.Re-enabled linting and testing in CI. A bunch of tests were fixed. Old e2e tests were ignored. Clippy warnings fixed.UPD. moved to separate PR
Notes
Doing all this revealed a number of questions. They are not resolved in this PR, however I will list them here for further discussions.
{Byte,Core,Time}Unit::String
variants. Probably private implementation pattern should be used here for better API:bytesize::ByteSize
andgevulot_rs::models::ByteUnit
. We use "megabyte" to represent mebibytes, butbytesize
separates them. Because of thatByteUnit<DefaultFactorOneMegabyte>::from(1)
and"1MB".parse::<ByteUnit>()
are not the same.CoreUnit
doesn't implement fractional parse, however it was mentioned in tests. This doesn't work:"1.5cpus".parse::<CoreUnit>()
. Do we want this?