Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move icu_plurals and icu_decimal to no_std #888

Merged
merged 11 commits into from
Jul 22, 2021

Conversation

Manishearth
Copy link
Member

Progress towards #812

@Manishearth Manishearth requested review from filmil, sffc, zbraniecki and a team as code owners July 22, 2021 16:21
@@ -80,6 +79,9 @@ impl PluralOperands {
/// Returns the number represented by this [`PluralOperands`] as floating point.
/// The precision of the number returned is up to the representation accuracy
/// of a double.
///
/// This method requires the `"std"` feature be enabled
#[cfg(feature = "std")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth highlighting: some of the math functions aren't in std

@@ -29,6 +29,7 @@ all-features = true
ecma402_traits = { version = "0.2.0" }
icu = { path = "../../components/icu", default-features = false }
icu_provider = { version = "0.2", path = "../../provider/core" }
icu_plurals = { version = "0.2", path = "../../components/plurals", features = ["std"] }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add this because ecma402_traits requires error types to implement Error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Manishearth Manishearth changed the title Move icu_plurals to no_std Move icu_plurals and icu_decimal to no_std Jul 22, 2021
sffc
sffc previously approved these changes Jul 22, 2021
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "n" function being behind std seems odd, but I think it's mostly not used

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2021

Codecov Report

Merging #888 (8de6064) into main (77e8269) will increase coverage by 0.09%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #888      +/-   ##
==========================================
+ Coverage   74.27%   74.36%   +0.09%     
==========================================
  Files         211      206       -5     
  Lines       13129    13058      -71     
==========================================
- Hits         9751     9711      -40     
+ Misses       3378     3347      -31     
Impacted Files Coverage Δ
components/decimal/src/error.rs 0.00% <ø> (ø)
components/decimal/src/lib.rs 94.44% <ø> (ø)
components/decimal/src/provider.rs 45.45% <ø> (ø)
components/plurals/src/data.rs 78.94% <ø> (ø)
components/plurals/src/error.rs 33.33% <ø> (ø)
components/plurals/src/lib.rs 86.95% <ø> (ø)
components/plurals/src/provider.rs 22.22% <ø> (ø)
components/plurals/src/rules/ast.rs 35.29% <ø> (ø)
components/plurals/src/rules/lexer.rs 90.10% <ø> (ø)
components/plurals/src/rules/parser.rs 96.25% <ø> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77e8269...8de6064. Read the comment docs.

@coveralls
Copy link

coveralls commented Jul 22, 2021

Pull Request Test Coverage Report for Build 1d1bebc8176995db31b9e75b1eaed997264901cd-PR-888

  • 3 of 4 (75.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 74.431%

Changes Missing Coverage Covered Lines Changed/Added Lines %
components/plurals/src/operands.rs 2 3 66.67%
Totals Coverage Status
Change from base Build 77e8269d25798b7a4963bee1a0b639659bfe2d57: 0.0%
Covered Lines: 9842
Relevant Lines: 13223

💛 - Coveralls

@Manishearth
Copy link
Member Author

The "n" function being behind std seems odd, but I think it's mostly not used

There's been discussion about the math functions being a part of std in the past; the contention is that baremetal targets may wish to plug in their own. We could include a no_std manual powi() function that's slower but workable if we really want, but that function isn't used much so I didn't bother.

@Manishearth Manishearth requested a review from sffc July 22, 2021 17:01
@Manishearth Manishearth merged commit b76cb79 into unicode-org:main Jul 22, 2021
@Manishearth Manishearth deleted the pr-nostd branch July 22, 2021 18:01
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.

4 participants