Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ libc = "0.2"
ord_subset = { optional = true, version = "3" }
rustc-serialize = { optional = true, version = "0.3" }
serde = { optional = true, version = "1" }
void = "1.0"

[features]
default = ["ord_subset", "rustc-serialize", "serde"]
Expand Down
7 changes: 4 additions & 3 deletions src/dec128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use std::ops::{Add, AddAssign, Sub, SubAssign, Mul, MulAssign, Div, DivAssign, R
ShlAssign, Shr, ShrAssign};
use std::str::FromStr;
use std::str::from_utf8_unchecked;
use void::Void;

thread_local!(static CTX: RefCell<Context> = RefCell::new(d128::default_context()));

Expand Down Expand Up @@ -185,10 +186,10 @@ impl AsRef<d128> for d128 {
/// no limit to the coefficient length for finite inputs; NaN payloads must be integers with no
/// more than 33 digits. Exponents may have up to nine significant digits. The syntax of the string
/// is fully checked; if it is not valid, the result will be a quiet NaN and an error flag will be
/// set.
/// set - the `Result` will never be an `Err` variant.
impl FromStr for d128 {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
type Err = Void;
fn from_str(s: &str) -> Result<Self, Void> {
let cstr = match CString::new(s) {
Err(..) => CString::new("qNaN").unwrap(),
Ok(cstr) => cstr,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extern crate serde;
#[cfg(feature = "serde")]
#[cfg(test)]
extern crate serde_json;
extern crate void;

#[macro_export]
/// A macro to construct d128 literals.
Expand Down