zbraniecki / pluralrules

Pluralization handling in Rust
36 stars 4 forks source link

Add dedicated impls for PluralOperands::from for integers, avoid unnecessary string allocations #19

Closed Manishearth closed 6 years ago

Manishearth commented 6 years ago

Currently we always convert to a string before parsing. This has two problems:

This uses a new trait so that we can specialize the implementation and be fast for the common cases.

part of https://github.com/unclenachoduh/pluralrules/issues/14

r? @unclenachoduh @zbraniecki

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 104


Changes Missing Coverage Covered Lines Changed/Added Lines %
intl_pluralrules/src/operands.rs 12 17 70.59%
<!-- Total: 13 18 72.22% -->
Totals Coverage Status
Change from base Build 103: -0.5%
Covered Lines: 540
Relevant Lines: 601

💛 - Coveralls