diff --git a/Cargo.toml b/Cargo.toml index 9e7f024..c4afcb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] nom = "7.1.3" -uniffi = { version = "0.26.1", optional = true } +uniffi = { version = "0.26.1" } [lib] crate-type = ["staticlib", "lib"] @@ -18,7 +18,8 @@ nom-test-helpers = "6.1.3" rayon = "1.8.0" [build-dependencies] -uniffi = { version = "0.26.1", features = [ "build" ], optional = true } +uniffi = { version = "0.26.1", features = [ "build" ] } [features] -uniffi = ["dep:uniffi"] \ No newline at end of file +# uniffi = ["dep:uniffi"] +uniffi = [] \ No newline at end of file diff --git a/src/label.rs b/src/label.rs index fab1c05..61688da 100644 --- a/src/label.rs +++ b/src/label.rs @@ -1,5 +1,4 @@ -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq, uniffi::Record)] pub struct Label { /// The name of the label pub name: String, diff --git a/src/lib.rs b/src/lib.rs index 7cf811b..9aaa9e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ pub mod line; pub mod token; pub mod word; -#[cfg(feature = "uniffi")] +// #[cfg(feature = "uniffi")] mod uniffi_array; use label::Label; @@ -22,7 +22,7 @@ use nom::{ use token::Token; use word::Word; -#[cfg(feature = "uniffi")] +// #[cfg(feature = "uniffi")] uniffi::setup_scaffolding!(); /// Takes the comment section of a KMD line. This parser basically just takes everything up until a diff --git a/src/line.rs b/src/line.rs index c61cdff..e7ffb4f 100644 --- a/src/line.rs +++ b/src/line.rs @@ -1,7 +1,6 @@ use crate::word::Word; -#[derive(Clone, Debug, PartialEq, Eq)] -#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq, Eq, uniffi::Record)] pub struct Line { pub memory_address: Option, pub word: Option, diff --git a/src/token.rs b/src/token.rs index 8312589..658b826 100644 --- a/src/token.rs +++ b/src/token.rs @@ -1,7 +1,6 @@ use crate::{label::Label, line::Line}; -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[derive(Clone, Debug, PartialEq, uniffi::Enum)] pub enum Token { Tag, Line { line: Line }, diff --git a/src/word.rs b/src/word.rs index bb8996e..2c2a7cd 100644 --- a/src/word.rs +++ b/src/word.rs @@ -1,5 +1,4 @@ -#[derive(Clone, Debug, PartialEq, Eq)] -#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[derive(Clone, Debug, PartialEq, Eq, uniffi::Enum)] pub enum Word { /// An instruction, represented as 4 bytes. kmdparse handles flipping the bytes, so that /// instructions are the right way around.