Skip to content

Comments

Clean up arithmetic dimensionality#11

Closed
HadrienG2 wants to merge 1 commit intobytesize-rs:masterfrom
HadrienG2:dimensionality
Closed

Clean up arithmetic dimensionality#11
HadrienG2 wants to merge 1 commit intobytesize-rs:masterfrom
HadrienG2:dimensionality

Conversation

@HadrienG2
Copy link
Contributor

Doing arithmetic between ByteSizes and raw integers requires a little bit of care

  • Adding together ByteSizes and raw integers should be disallowed, as it encourages people to work with raw byte counts instead of explicitly stating what they mean.
  • Multiplication of ByteSizes and integers should be commutative.

This was discussed in issue #2, and this MR implements the proposed set of arithmetic operators.

@HadrienG2 HadrienG2 changed the title Clean up arithmetic dimensionality as discussed in #2 Clean up arithmetic dimensionality Sep 26, 2017
@hyunsik
Copy link
Member

hyunsik commented Mar 24, 2018

I'm sorry for a late response. As you suggested, I also cleaned up the arithmetic operators. You can see the improvement at https://github.com/hyunsik/bytesize/releases/tag/release-0.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants