Skip to content

Commit

Permalink
fix json benchmark compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Apr 9, 2018
1 parent db5cb32 commit 727006b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion benches/ini.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate test;
#[macro_use]
extern crate nom;

use nom::{alphanumeric, multispace, space, IResult};
use nom::{alphanumeric, multispace, space};

use std::str;
use std::collections::HashMap;
Expand Down
8 changes: 8 additions & 0 deletions benches/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::collections::HashMap;
#[derive(Debug, PartialEq)]
pub enum JsonValue {
Str(String),
Boolean(bool),
Num(f32),
Array(Vec<JsonValue>),
Object(HashMap<String, JsonValue>),
Expand All @@ -36,6 +37,13 @@ named!(
)
);

named!(boolean<bool>,
alt!(
value!(false, tag!("false")) |
value!(true, tag!("true"))
)
);

named!(
array<Vec<JsonValue>>,
ws!(delimited!(
Expand Down

0 comments on commit 727006b

Please sign in to comment.