Removes deprecated methods from oxsdatatypes

pull/553/head
Tpt 2 years ago committed by Thomas Tanon
parent 01caaa5d70
commit 5af06e926a
  1. 12
      lib/oxsdatatypes/src/decimal.rs
  2. 6
      lib/oxsdatatypes/src/double.rs
  3. 35
      lib/oxsdatatypes/src/duration.rs
  4. 6
      lib/oxsdatatypes/src/float.rs
  5. 10
      lib/oxsdatatypes/src/integer.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 {

@ -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()

@ -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<YearMonthDuration> 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<DayTimeDuration> 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::*;

@ -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()

@ -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<Float> for Integer {
type Error = DecimalOverflowError;

Loading…
Cancel
Save