Skip to content

Commit

Permalink
fix: use BTreeMap in session outputs, ref #173
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Mar 12, 2024
1 parent d0a934d commit 39bd0d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/session/output.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{
collections::HashMap,
collections::BTreeMap,
ffi::c_void,
ops::{Deref, DerefMut, Index}
};
Expand All @@ -26,7 +26,7 @@ use crate::{Allocator, Value};
/// ```
#[derive(Debug)]
pub struct SessionOutputs<'s> {
map: HashMap<&'s str, Value>,
map: BTreeMap<&'s str, Value>,
idxs: Vec<&'s str>,
backing_ptr: Option<(&'s Allocator, *mut c_void)>
}
Expand Down Expand Up @@ -59,7 +59,7 @@ impl<'s> SessionOutputs<'s> {

pub(crate) fn new_empty() -> Self {
Self {
map: HashMap::new(),
map: BTreeMap::new(),
idxs: Vec::new(),
backing_ptr: None
}
Expand All @@ -75,7 +75,7 @@ impl<'s> Drop for SessionOutputs<'s> {
}

impl<'s> Deref for SessionOutputs<'s> {
type Target = HashMap<&'s str, Value>;
type Target = BTreeMap<&'s str, Value>;

fn deref(&self) -> &Self::Target {
&self.map
Expand Down

0 comments on commit 39bd0d0

Please sign in to comment.