use index map in imports module

This commit is contained in:
collin 2020-12-07 12:10:42 -05:00
parent 5d2136b518
commit ae6ee186ad
2 changed files with 8 additions and 6 deletions

View File

@ -25,6 +25,10 @@ version = "1.0.6"
path = "../grammar"
version = "1.0.6"
[dependencies.indexmap]
version = "1.6.0"
features = ["serde-1"]
[dependencies.thiserror]
version = "1.0"

View File

@ -17,10 +17,8 @@
use crate::errors::ImportParserError;
use leo_ast::{Package, Program};
use std::{
collections::{HashMap, HashSet},
env::current_dir,
};
use indexmap::{IndexMap, IndexSet};
use std::env::current_dir;
/// Stores imported packages.
///
@ -28,8 +26,8 @@ use std::{
/// directory, foreign in the imports directory, or part of the core package list.
#[derive(Clone, Default)]
pub struct ImportParser {
imports: HashMap<String, Program>,
core_packages: HashSet<Package>,
imports: IndexMap<String, Program>,
core_packages: IndexSet<Package>,
}
impl ImportParser {