Skip to content

Commit

Permalink
Enable CStr and CString in no-std enviroment
Browse files Browse the repository at this point in the history
  • Loading branch information
safarir committed Feb 10, 2023
1 parent 35e5cf3 commit bd4a098
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ mod lib {
pub use self::core::clone::{self, Clone};
pub use self::core::convert::{self, From, Into};
pub use self::core::default::{self, Default};
pub use self::core::ffi::CStr;
pub use self::core::fmt::{self, Debug, Display};
pub use self::core::marker::{self, PhantomData};
pub use self::core::num::Wrapping;
Expand Down Expand Up @@ -218,13 +219,18 @@ mod lib {
#[cfg(feature = "std")]
pub use std::collections::{BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque};

#[cfg(all(feature = "alloc", not(feature = "std")))]
pub use alloc::ffi::{CString};
#[cfg(feature = "std")]
pub use std::ffi::{CString};

#[cfg(feature = "std")]
pub use std::{error, net};

#[cfg(feature = "std")]
pub use std::collections::{HashMap, HashSet};
#[cfg(feature = "std")]
pub use std::ffi::{CStr, CString, OsStr, OsString};
pub use std::ffi::{OsStr, OsString};
#[cfg(feature = "std")]
pub use std::hash::{BuildHasher, Hash};
#[cfg(feature = "std")]
Expand Down

0 comments on commit bd4a098

Please sign in to comment.