diff --git a/dust-lang/src/context.rs b/dust-lang/src/context.rs index c829a65..38aa9ab 100644 --- a/dust-lang/src/context.rs +++ b/dust-lang/src/context.rs @@ -1,5 +1,5 @@ use std::{ - collections::BTreeMap, + collections::HashMap, sync::{Arc, RwLock, RwLockReadGuard}, }; @@ -12,7 +12,7 @@ use crate::{ #[derive(Clone, Debug)] pub struct Context<'a> { - variables: Arc>>, + variables: Arc>>, parent: Option<&'a Context<'a>>, is_clean: Arc>, } @@ -20,7 +20,7 @@ pub struct Context<'a> { impl<'a> Context<'a> { pub fn new(parent: Option<&'a Context>) -> Self { Self { - variables: Arc::new(RwLock::new(BTreeMap::new())), + variables: Arc::new(RwLock::new(HashMap::new())), parent, is_clean: Arc::new(RwLock::new(true)), } @@ -32,7 +32,7 @@ impl<'a> Context<'a> { pub fn inner( &self, - ) -> Result>, RwLockPoisonError> + ) -> Result>, RwLockPoisonError> { Ok(self.variables.read()?) }