Skip to content

Commit

Permalink
fix wasm build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anweiss committed Oct 25, 2022
1 parent b1005f0 commit d0e2b76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ pub enum Token<'a> {
}

/// Control operator tokens
#[cfg_attr(target_arch = "wasm32", derive(Serialize))]
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub enum ControlOperator {
// Control operators
Expand Down
4 changes: 2 additions & 2 deletions src/validator/cbor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1492,8 +1492,8 @@ where
}
#[cfg(feature = "additional-controls")]
#[cfg(target_arch = "wasm32")]
t @ Some(Token::FEATURE) => {
self.ctrl = t;
ControlOperator::FEATURE => {
self.ctrl = Some(ctrl);

if let Some(ef) = &self.enabled_features {
let tv = text_value_from_type2(self.cddl, controller);
Expand Down
4 changes: 2 additions & 2 deletions src/validator/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,8 +1475,8 @@ impl<'a, 'b> Visitor<'a, 'b, Error> for JSONValidator<'a> {
}
#[cfg(feature = "additional-controls")]
#[cfg(target_arch = "wasm32")]
t @ Some(Token::FEATURE) => {
self.ctrl = t;
ControlOperator::FEATURE => {
self.ctrl = Some(ctrl);

if let Some(ef) = &self.enabled_features {
let tv = text_value_from_type2(self.cddl, controller);
Expand Down

0 comments on commit d0e2b76

Please sign in to comment.