refactor(headers): Use u16 based newtype for quality value

Using floating point numbers is problematic because comparison is inexact.
They also take more space than integral numbers in this case.

Add `FromPrimitve`, `ToPrimitive` and `Default` traits to quality newtype.

Closes: #330

BREAKING_CHANGE: Replace f32 quality values in quality items with a
Quality(u16) newtype. Valid values are from 0 to 1000.
This commit is contained in:
Pyfisch
2015-02-22 16:51:53 +01:00
parent b1b8bf1db7
commit 8f6ce453de
6 changed files with 202 additions and 114 deletions

View File

@@ -1,6 +1,6 @@
pub use self::encoding::Encoding;
pub use self::entity::EntityTag;
pub use self::quality_item::{QualityItem, qitem};
pub use self::quality_item::{Quality, QualityItem, qitem};
mod encoding;
mod entity;