feat: Add ton_per_minute and ton_per_day#405
Merged
Merged
Conversation
Owner
|
Thanks for the PR! I'm inclined to keep Below are a few changes. I think we might as well take this opportunity to move the comments into doc comments. diff --git a/src/si/mass.rs b/src/si/mass.rs
index cd9a147..501f651 100644
--- a/src/si/mass.rs
+++ b/src/si/mass.rs
@@ -54,6 +54,7 @@ quantity! {
@ton_assay: 2.916_667_E-2; "AT", "assay ton", "assay tons";
@ton_long: 1.016_047_E3; "2240 lb", "long ton", "long tons";
@ton_short: 9.071_847_E2; "2000 lb", "short ton", "short tons";
- @ton: 1.0_E3; "t", "ton", "tons"; // ton, metric
+ /// Ton, metric.
+ @ton: 1.0_E3; "t", "ton", "tons";
}
}
diff --git a/src/si/mass_rate.rs b/src/si/mass_rate.rs
index 056bfa2..a21d220 100644
--- a/src/si/mass_rate.rs
+++ b/src/si/mass_rate.rs
@@ -95,12 +95,12 @@ quantity! {
"short tons per second";
@ton_short_per_hour: 2.519_957_5_E-1; "2000 lb/h", "short ton per hour",
"short tons per hour";
- @ton_per_second: 1.0_E3; "t/s", "ton per second",
- "tons per second"; // ton per second, metric
- @ton_per_minute: 1.666_666_666_666_666_6_E1; "t/min", "ton per minute",
- "tons per minute"; // ton per minute, metric
- @ton_per_day: 1.1574074074074E-2; "t/d", "ton per day",
- "tons per day"; // ton per day, metric
+ /// Ton per second, metric.
+ @ton_per_second: 1.0_E3; "t/s", "ton per second", "tons per second";
+ /// Ton per minute, metric.
+ @ton_per_minute: 1.666_666_666_666_666_6_E1; "t/min", "ton per minute", "tons per minute";
+ /// Ton per day, metric.
+ @ton_per_day: 1.157_407_407_407_407_4_E-2; "t/d", "ton per day", "tons per day";
}
} |
Contributor
Author
|
Oh, I didn't know that docs after the function was a thing! I'll fix those right away |
Contributor
Author
|
Does the changes look Ok now? |
Contributor
Author
|
Adding ton_per_hour as well, forgot that one |
Owner
|
Changes look good. Kicked off the tests and if they pass I will merge. |
Owner
|
Actually, one last change! Can you squash your commits and update the commit message. Something like the following: |
ton_per_hour, ton_per_day
Contributor
Author
|
Attempted to squash them(I have no idea how to properly do that) 🤣 |
Owner
|
Merged, thanks! |
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.
This PR attempts to add the ton_per_minute and ton_per_day units to flow rate.
Regarding the name of ton, I'd like to propose changing it to tonne, to avoid confusion with long and short ton. Or metric_ton.