Make std optional

This commit is contained in:
Max 2023-02-22 14:16:24 +01:00
parent cfc0506dc0
commit ed4d0ee1fd
3 changed files with 14 additions and 0 deletions

View File

@ -17,4 +17,6 @@ num-traits = "0.2"
defmt = { version = "0.3", optional = true } defmt = { version = "0.3", optional = true }
[features] [features]
default = ["std"]
defmt = ["dep:defmt"] defmt = ["dep:defmt"]
std = []

View File

@ -1,3 +1,6 @@
#[cfg(not(feature = "std"))]
use core::fmt::{Display, Formatter};
#[cfg(feature = "std")]
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use typenum::Integer; use typenum::Integer;

View File

@ -1,6 +1,15 @@
mod display; mod display;
pub mod types; pub mod types;
#[cfg(not(feature = "std"))]
use core::{
marker::PhantomData,
ops::{
Add, AddAssign, Deref, DerefMut, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub,
SubAssign,
},
};
#[cfg(feature = "std")]
use std::{ use std::{
marker::PhantomData, marker::PhantomData,
ops::{ ops::{