Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
akubera committed Aug 26, 2021
2 parents 5b2976d + 7d7aebc commit 272123e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
debian-version:
type: string
default: "buster"
rust-features:
type: string
default: "''"
docker:
- image: rust:<< parameters.rust-version >>-<< parameters.debian-version >>
environment:
Expand All @@ -36,7 +39,7 @@ jobs:
command: cargo build
- run:
name: Test
command: cargo test
command: cargo test --features=<< parameters.rust-features >>

upload-coverage:
parameters:
Expand Down Expand Up @@ -91,6 +94,15 @@ workflows:
- "1.40.0"
- "1.50.0"
- "1.54.0"
- build-and-test:
matrix:
parameters:
rust-version:
- "1.50.0"
- "1.54.0"
rust-features:
- "'serde'"
- "'serde,string-only'"
- upload-coverage:
rust-version: "1.54.0"
requires:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bigdecimal"
version = "0.2.2"
version = "0.3.0"
authors = ["Andrew Kubera"]
description = "Arbitrary precision decimal numbers"
documentation = "https://docs.rs/bigdecimal"
Expand All @@ -10,7 +10,7 @@ keywords = ["mathematics", "numerics", "decimal", "arbitrary-precision", "floati
license = "MIT/Apache-2.0"

[dependencies]
num-bigint = "0.3"
num-bigint = "0.4"
num-integer = "0.1"
num-traits = "0.2"
serde = { version = "1.0", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,9 @@ mod bigdecimal_serde {
use serde::{de, ser};
use std::convert::TryFrom;
use std::fmt;
use std::str::FromStr;
#[allow(unused_imports)]
use num_traits::FromPrimitive;

impl ser::Serialize for BigDecimal {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
Expand All @@ -1836,7 +1839,6 @@ mod bigdecimal_serde {
where
E: de::Error,
{
use std::str::FromStr;
BigDecimal::from_str(value).map_err(|err| E::custom(format!("{}", err)))
}

Expand Down Expand Up @@ -1942,8 +1944,6 @@ mod bigdecimal_serde {
#[test]
#[cfg(not(feature = "string-only"))]
fn test_serde_deserialize_int() {
use traits::FromPrimitive;

let vals = vec![0, 1, 81516161, -370, -8, -99999999999];
for n in vals {
let expected = BigDecimal::from_i64(n).unwrap();
Expand Down

0 comments on commit 272123e

Please sign in to comment.