Skip to content

Commit

Permalink
Use Rust 2018 format for crates (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
404salad committed Oct 23, 2023
1 parent 5d30733 commit ab70fe6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,15 @@ The grammar can be used to derive a `Parser` implementation automatically.
Parsing returns an iterator of nested token pairs:

```rust
extern crate pest;
#[macro_use]
extern crate pest_derive;

use pest_derive::Parser;
use pest::Parser;

#[derive(Parser)]
#[grammar = "ident.pest"]
struct IdentParser;

fn main() {
   let pairs = IdentParser::parse(Rule::ident_list, "a1 b2").unwrap_or_else(|e| panic!("{}", e));
let pairs = IdentParser::parse(Rule::ident_list, "a1 b2").unwrap_or_else(|e| panic!("{}", e));

// Because ident_list is silent, the iterator will contain idents
for pair in pairs {
Expand Down

0 comments on commit ab70fe6

Please sign in to comment.