From 06672cbde9f089f82ea7d9adc823715fdcdba336 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 26 Feb 2018 18:27:13 -1000 Subject: [PATCH] Upgrade ordermap dependency to indexmap. (#227) Avoid the need for indexmap-based applications to build ordermap, which is the old name for indexmap. Signed-off-by: Brian Smith --- Cargo.toml | 2 +- src/lib.rs | 2 +- src/proto/streams/store.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 93961c8..b13c85a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ log = "0.4.1" fnv = "1.0.5" slab = "0.4.0" string = "0.1" -ordermap = "0.2" +indexmap = "0.4" [dev-dependencies] tokio-timer = "0.1" diff --git a/src/lib.rs b/src/lib.rs index 81aec71..2efb465 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -108,7 +108,7 @@ extern crate slab; #[macro_use] extern crate log; extern crate string; -extern crate ordermap; +extern crate indexmap; mod error; #[cfg_attr(feature = "unstable", allow(missing_docs))] diff --git a/src/proto/streams/store.rs b/src/proto/streams/store.rs index dc8834f..ea4f5fd 100644 --- a/src/proto/streams/store.rs +++ b/src/proto/streams/store.rs @@ -2,7 +2,7 @@ use super::*; use slab; -use ordermap::{self, OrderMap}; +use indexmap::{self, IndexMap}; use std::marker::PhantomData; use std::ops; @@ -11,7 +11,7 @@ use std::ops; #[derive(Debug)] pub(super) struct Store { slab: slab::Slab<(StoreId, Stream)>, - ids: OrderMap, + ids: IndexMap, counter: StoreId, } @@ -61,11 +61,11 @@ pub(super) enum Entry<'a> { } pub(super) struct OccupiedEntry<'a> { - ids: ordermap::OccupiedEntry<'a, StreamId, (usize, StoreId)>, + ids: indexmap::map::OccupiedEntry<'a, StreamId, (usize, StoreId)>, } pub(super) struct VacantEntry<'a> { - ids: ordermap::VacantEntry<'a, StreamId, (usize, StoreId)>, + ids: indexmap::map::VacantEntry<'a, StreamId, (usize, StoreId)>, slab: &'a mut slab::Slab<(StoreId, Stream)>, counter: &'a mut usize, } @@ -80,7 +80,7 @@ impl Store { pub fn new() -> Self { Store { slab: slab::Slab::new(), - ids: OrderMap::new(), + ids: IndexMap::new(), counter: 0, } } @@ -116,7 +116,7 @@ impl Store { } pub fn find_entry(&mut self, id: StreamId) -> Entry { - use self::ordermap::Entry::*; + use self::indexmap::map::Entry::*; match self.ids.entry(id) { Occupied(e) => Entry::Occupied(OccupiedEntry {