From 834cd60b74fa21592be516186041abac423ea1a8 Mon Sep 17 00:00:00 2001 From: Tpt Date: Tue, 13 Jun 2023 10:04:38 +0200 Subject: [PATCH] Removes deprecated methods from oxsdatatypes --- lib/oxsdatatypes/src/decimal.rs | 12 ----------- lib/oxsdatatypes/src/double.rs | 6 ------ lib/oxsdatatypes/src/duration.rs | 35 -------------------------------- lib/oxsdatatypes/src/float.rs | 6 ------ lib/oxsdatatypes/src/integer.rs | 10 --------- 5 files changed, 69 deletions(-) diff --git a/lib/oxsdatatypes/src/decimal.rs b/lib/oxsdatatypes/src/decimal.rs index 0fd4d3db..412ca2b8 100644 --- a/lib/oxsdatatypes/src/decimal.rs +++ b/lib/oxsdatatypes/src/decimal.rs @@ -2,7 +2,6 @@ use crate::{Boolean, Double, Float, Integer}; use std::error::Error; use std::fmt; use std::fmt::Write; -use std::ops::Neg; use std::str::FromStr; const DECIMAL_PART_DIGITS: u32 = 18; @@ -564,17 +563,6 @@ impl fmt::Display for Decimal { } } -impl Neg for Decimal { - type Output = Self; - - #[inline] - fn neg(self) -> Self { - Self { - value: self.value.neg(), - } - } -} - /// An error when parsing a [`Decimal`]. #[derive(Debug, Clone)] pub struct ParseDecimalError { diff --git a/lib/oxsdatatypes/src/double.rs b/lib/oxsdatatypes/src/double.rs index 64d3c786..6768c772 100644 --- a/lib/oxsdatatypes/src/double.rs +++ b/lib/oxsdatatypes/src/double.rs @@ -58,12 +58,6 @@ impl Double { self.value.is_nan() } - #[deprecated(note = "Use .is_nan()")] - #[inline] - pub fn is_naan(self) -> bool { - self.value.is_nan() - } - #[inline] pub fn is_finite(self) -> bool { self.value.is_finite() diff --git a/lib/oxsdatatypes/src/duration.rs b/lib/oxsdatatypes/src/duration.rs index 14ea6aac..29167121 100644 --- a/lib/oxsdatatypes/src/duration.rs +++ b/lib/oxsdatatypes/src/duration.rs @@ -3,7 +3,6 @@ use super::parser::*; use super::*; use std::cmp::Ordering; use std::fmt; -use std::ops::Neg; use std::str::FromStr; use std::time::Duration as StdDuration; @@ -232,18 +231,6 @@ impl PartialOrd for Duration { } } -impl Neg for Duration { - type Output = Self; - - #[inline] - fn neg(self) -> Self { - Self { - year_month: self.year_month.neg(), - day_time: self.day_time.neg(), - } - } -} - /// [XML Schema `yearMonthDuration` datatype](https://www.w3.org/TR/xmlschema11-2/#yearMonthDuration) /// /// It stores the duration as a number of months encoded using a [`i64`]. @@ -391,17 +378,6 @@ impl PartialOrd for Duration { } } -impl Neg for YearMonthDuration { - type Output = Self; - - #[inline] - fn neg(self) -> Self { - Self { - months: self.months.neg(), - } - } -} - /// [XML Schema `dayTimeDuration` datatype](https://www.w3.org/TR/xmlschema11-2/#dayTimeDuration) /// /// It stores the duration as a number of seconds encoded using a [`Decimal`]. @@ -602,17 +578,6 @@ impl PartialOrd for YearMonthDuration { } } -impl Neg for DayTimeDuration { - type Output = Self; - - #[inline] - fn neg(self) -> Self { - Self { - seconds: self.seconds.neg(), - } - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/lib/oxsdatatypes/src/float.rs b/lib/oxsdatatypes/src/float.rs index 86616a24..8c8602d3 100644 --- a/lib/oxsdatatypes/src/float.rs +++ b/lib/oxsdatatypes/src/float.rs @@ -53,12 +53,6 @@ impl Float { self.value.round().into() } - #[deprecated(note = "Use .is_nan()")] - #[inline] - pub fn is_naan(self) -> bool { - self.value.is_nan() - } - #[inline] pub fn is_nan(self) -> bool { self.value.is_nan() diff --git a/lib/oxsdatatypes/src/integer.rs b/lib/oxsdatatypes/src/integer.rs index 87d2dbd7..325c62d1 100644 --- a/lib/oxsdatatypes/src/integer.rs +++ b/lib/oxsdatatypes/src/integer.rs @@ -1,7 +1,6 @@ use crate::{Boolean, Decimal, DecimalOverflowError, Double, Float}; use std::fmt; use std::num::ParseIntError; -use std::ops::Neg; use std::str::FromStr; /// [XML Schema `integer` datatype](https://www.w3.org/TR/xmlschema11-2/#integer) @@ -210,15 +209,6 @@ impl fmt::Display for Integer { } } -impl Neg for Integer { - type Output = Self; - - #[inline] - fn neg(self) -> Self { - (-self.value).into() - } -} - impl TryFrom for Integer { type Error = DecimalOverflowError;