From 6ef11130281a16e5ca23250ac78bcd27c777a14e Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 15 Apr 2019 17:43:39 +0200 Subject: Keep rule order in `abnf_to_pest` Closes #79 --- abnf_to_pest/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'abnf_to_pest/src/lib.rs') diff --git a/abnf_to_pest/src/lib.rs b/abnf_to_pest/src/lib.rs index 46bd79d..f1a167f 100644 --- a/abnf_to_pest/src/lib.rs +++ b/abnf_to_pest/src/lib.rs @@ -8,7 +8,7 @@ pub use abnf::abnf::{ }; use itertools::Itertools; use pretty::{BoxDoc, Doc}; -use std::collections::HashMap; +use indexmap::map::IndexMap; trait Pretty { fn pretty(&self) -> Doc<'static, BoxDoc<'static, ()>>; @@ -146,7 +146,7 @@ impl Pretty for (String, PestyRule) { /// Parse an abnf file. Returns a map of rules. pub fn parse_abnf( data: &[u8], -) -> Result, std::io::Error> { +) -> Result, std::io::Error> { let make_err = |e| std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e)); let rules: Vec = -- cgit v1.2.3