Remove const impl
This commit is contained in:
parent
67daf8d73f
commit
4c73f860d3
@ -25,5 +25,4 @@ default = ["std"]
|
||||
defmt = ["dep:defmt"]
|
||||
fixed = ["dep:fixed"]
|
||||
std = ["num-traits/std"]
|
||||
nightly = []
|
||||
serde = ["dep:serde"]
|
||||
|
35
src/lib.rs
35
src/lib.rs
@ -1,6 +1,4 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(feature = "nightly", feature(const_trait_impl))]
|
||||
#![cfg_attr(feature = "nightly", feature(trait_alias))]
|
||||
mod display;
|
||||
pub mod types;
|
||||
|
||||
@ -42,9 +40,6 @@ where
|
||||
_cd: PhantomData<Candela>,
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
impl<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela> Deref
|
||||
for SiUnit<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>
|
||||
where
|
||||
Second: Integer,
|
||||
Metre: Integer,
|
||||
@ -54,14 +49,9 @@ where
|
||||
Mole: Integer,
|
||||
Candela: Integer,
|
||||
{
|
||||
type Target = T;
|
||||
}
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.value
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "nightly")]
|
||||
impl<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela> const Deref
|
||||
impl<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela> Deref
|
||||
for SiUnit<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>
|
||||
where
|
||||
Second: Integer,
|
||||
@ -95,7 +85,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
impl<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela> Neg
|
||||
for SiUnit<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>
|
||||
where
|
||||
@ -114,26 +103,6 @@ where
|
||||
Self::Output::new(-self.value)
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "nightly")]
|
||||
impl<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela> const Neg
|
||||
for SiUnit<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>
|
||||
where
|
||||
Second: Integer,
|
||||
Metre: Integer,
|
||||
Kilogram: Integer,
|
||||
Ampere: Integer,
|
||||
Kelvin: Integer,
|
||||
Mole: Integer,
|
||||
Candela: Integer,
|
||||
T: ~const Neg,
|
||||
Self: ~const Destruct,
|
||||
{
|
||||
type Output = SiUnit<T::Output, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>;
|
||||
|
||||
fn neg(self) -> Self::Output {
|
||||
Self::Output::new(-self.value)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela> Zero
|
||||
for SiUnit<T, Second, Metre, Kilogram, Ampere, Kelvin, Mole, Candela>
|
||||
|
Loading…
Reference in New Issue
Block a user