Skip to content

Commit

Permalink
Update to Rust 2021 (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
c410-f3r committed May 16, 2022
1 parent 2b582d6 commit a963e79
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:

- uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0
toolchain: 1.56.0
profile: minimal
override: true

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = ["Paul Mason <paul@form1.co.nz>"]
categories = ["science","mathematics","data-structures"]
description = "Decimal number implementation written in pure Rust suitable for financial and fixed-precision calculations."
documentation = "https://docs.rs/rust_decimal/"
edition = "2018"
edition = "2021"
exclude = [ "tests/generated/*" ]
keywords = ["decimal","financial","fixed","precision","number"]
license = "MIT"
Expand Down Expand Up @@ -63,7 +63,7 @@ serde-arbitrary-precision = ["serde-with-arbitrary-precision"]
serde-bincode = ["serde-str"] # Backwards compatability
serde-float = ["serde-with-float"]
serde-str = ["serde-with-str"]
serde-with-arbitrary-precision = ["serde", "serde_json/arbitrary_precision"]
serde-with-arbitrary-precision = ["serde", "serde_json/arbitrary_precision", "serde_json/std"]
serde-with-float = ["serde"]
serde-with-str = ["serde"]
std = []
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ Please refer to the [Build document](BUILD.md) for more information on building

## Minimum Rust Compiler Version

The current _minimum_ compiler version is [`1.54.0`](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1540-2021-07-29)
which was released on `2021-07-29`.
The current _minimum_ compiler version is [`1.56.0`](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1560-2021-10-21)
which was released on `2021-10-21`.

This library maintains support for rust compiler versions that are 4 minor versions away from the current stable rust compiler version.
For example, if the current stable compiler version is `1.50.0` then we will guarantee support up to and including `1.46.0`.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ serde_json = { default-features = false, features = ["alloc"], version = "1.0" }

[package]
authors = ["Automatically generated"]
edition = "2018"
edition = "2021"
name = "rust-decimal-fuzz"
publish = false
version = "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rust_decimal_macros"
version = "1.23.1"
authors = ["Paul Mason <paul@form1.co.nz>"]
edition = "2018"
edition = "2021"
description = "Shorthand macros to assist creating Decimal types."
documentation = "https://docs.rs/rust_decimal/"
repository = "https://github.com/paupino/rust-decimal"
Expand Down
4 changes: 2 additions & 2 deletions src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ macro_rules! impl_try_from_decimal {
stringify!($TInto),
"`.",
)]
impl core::convert::TryFrom<Decimal> for $TInto {
impl TryFrom<Decimal> for $TInto {
type Error = crate::Error;

#[inline]
Expand Down Expand Up @@ -1756,7 +1756,7 @@ macro_rules! impl_try_from_primitive {
stringify!($TFrom),
"` into a `Decimal`.\n\nCan fail if the value is out of range for `Decimal`."
)]
impl core::convert::TryFrom<$TFrom> for Decimal {
impl TryFrom<$TFrom> for Decimal {
type Error = crate::Error;

#[inline]
Expand Down
3 changes: 1 addition & 2 deletions src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
ops::array::{div_by_u32, is_all_zero, mul_by_u32},
Decimal,
};
use core::{convert::TryInto, fmt};
use core::fmt;
use std::error;

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -149,7 +149,6 @@ mod diesel_postgres {
serialize::{self, Output, ToSql},
sql_types::Numeric,
};
use core::convert::{TryFrom, TryInto};
use std::io::Write;

impl<'a> TryFrom<&'a PgNumeric> for Decimal {
Expand Down
6 changes: 1 addition & 5 deletions tests/decimal_tests.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
mod macros;

use core::{
cmp::Ordering::*,
convert::{TryFrom, TryInto},
str::FromStr,
};
use core::{cmp::Ordering::*, str::FromStr};
use num_traits::{Inv, Signed, ToPrimitive};
use rust_decimal::{Decimal, Error, RoundingStrategy};

Expand Down

0 comments on commit a963e79

Please sign in to comment.