Skip to content

Commit

Permalink
Try always applying uniffi
Browse files Browse the repository at this point in the history
  • Loading branch information
jmshrv committed Mar 8, 2024
1 parent 845de8c commit f794c31
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
# uniffi = ["dep:uniffi"]
uniffi = []
3 changes: 1 addition & 2 deletions src/label.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/line.rs
Original file line number Diff line number Diff line change
@@ -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<u32>,
pub word: Option<Word>,
Expand Down
3 changes: 1 addition & 2 deletions src/token.rs
Original file line number Diff line number Diff line change
@@ -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 },
Expand Down
3 changes: 1 addition & 2 deletions src/word.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit f794c31

Please sign in to comment.