diff --git a/src/lib.rs b/src/lib.rs index d937325..51ea79c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,14 +21,11 @@ use core::ops::{ #[cfg(feature = "serde")] use serde::{Deserialize, Deserializer, Serialize, Serializer}; -#[cfg(feature = "borsh")] -use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; - #[cfg(all(feature = "borsh", not(feature = "std")))] -use alloc::{collections::BTreeMap, string::ToString}; +use alloc::{collections::BTreeMap, string::ToString, vec}; #[cfg(all(feature = "borsh", feature = "std"))] -use std::{collections::BTreeMap, string::ToString}; +use std::{collections::BTreeMap, string::ToString, vec}; #[cfg(feature = "schemars")] use schemars::JsonSchema; @@ -1073,10 +1070,10 @@ where // Current ser/de for it is not optimal impl because const math is not stable nor primitives has bits traits. // Uses minimal amount of bytes to fit needed amount of bits without compression (borsh does not have it anyway). #[cfg(feature = "borsh")] -impl BorshSerialize for UInt +impl borsh::BorshSerialize for UInt where Self: Number, - T: BorshSerialize + T: borsh::BorshSerialize + From + BitAnd + TryInto @@ -1104,9 +1101,9 @@ where #[cfg(feature = "borsh")] impl< - T: BorshDeserialize + core::cmp::PartialOrd< as Number>::UnderlyingType>, + T: borsh::BorshDeserialize + PartialOrd< as Number>::UnderlyingType>, const BITS: usize, - > BorshDeserialize for UInt + > borsh::BorshDeserialize for UInt where Self: Number, { @@ -1126,7 +1123,7 @@ where } #[cfg(feature = "borsh")] -impl BorshSchema for UInt { +impl borsh::BorshSchema for UInt { fn add_definitions_recursively( definitions: &mut BTreeMap, ) {