Skip to content

Commit

Permalink
fix no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
indirection42 committed Jul 5, 2024
1 parent 88dbeba commit 93d67be
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xcq-types/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{boxed::Box, rc::Rc, sync::Arc};
use crate::{boxed::Box, rc::Rc, string::String, sync::Arc, vec::Vec};
use crate::{EnumType, Field, PrimitiveType, StructType, Variant};
use crate::{XcqType, XcqTypeInfo};
use fortuples::fortuples;
Expand Down
4 changes: 4 additions & 0 deletions xcq-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;

mod ty;
pub use ty::*;
mod impls;
Expand Down
2 changes: 0 additions & 2 deletions xcq-types/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(not(feature = "std"))]
extern crate alloc;

use cfg_if::cfg_if;

Expand Down
2 changes: 1 addition & 1 deletion xcq-types/src/ty/enum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::Field;
use crate::{vec::Vec, Field};

#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug)]
pub struct Variant {
Expand Down
1 change: 1 addition & 0 deletions xcq-types/src/ty/field.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::vec::Vec;
use crate::XcqType;
// A Named or Unnamed field in a composite type
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug)]
Expand Down
1 change: 1 addition & 0 deletions xcq-types/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod r#enum;
mod field;
mod primitive;
mod r#struct;
use crate::{boxed::Box, vec::Vec};

pub use self::{field::*, primitive::*, r#enum::*, r#struct::*};

Expand Down
3 changes: 1 addition & 2 deletions xcq-types/src/ty/struct.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::prelude::vec::Vec;
use crate::Field;
use crate::{vec::Vec, Field};

/// A struct type, consisting of a named (struct) or unnamed (tuple struct) fields or unit struct.
/// Note: in fact, it can represent a
Expand Down

0 comments on commit 93d67be

Please sign in to comment.