sp-std removal from substrate/primitives (#3274)

This PR removes sp-std crate from substrate/primitives sub-directories.

For now crates that have `pub use` of sp-std or export macros that would
necessitate users of the macros to `extern crate alloc` have been
excluded from this PR.

There should be no breaking changes in this PR.

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
This commit is contained in:
Squirrel
2024-03-18 05:29:35 +00:00
committed by GitHub
parent 6b1179f13b
commit 1b5f4243d1
110 changed files with 254 additions and 278 deletions
@@ -16,8 +16,8 @@
// limitations under the License.
use crate::{biguint::BigUint, helpers_128bit, Rounding};
use core::cmp::Ordering;
use num_traits::{Bounded, One, Zero};
use sp_std::{cmp::Ordering, prelude::*};
/// A wrapper for any rational number with infinitely large numerator and denominator.
///
@@ -92,15 +92,15 @@ impl From<Rational128> for RationalInfinite {
pub struct Rational128(u128, u128);
#[cfg(feature = "std")]
impl sp_std::fmt::Debug for Rational128 {
fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result {
impl core::fmt::Debug for Rational128 {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "Rational128({} / {} ≈ {:.8})", self.0, self.1, self.0 as f64 / self.1 as f64)
}
}
#[cfg(not(feature = "std"))]
impl sp_std::fmt::Debug for Rational128 {
fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result {
impl core::fmt::Debug for Rational128 {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "Rational128({} / {})", self.0, self.1)
}
}