Move to components/hashglobe

This commit is contained in:
Manish Goregaokar 2017-08-31 15:17:02 -07:00
parent ed0fa304fc
commit 5d3115fa8e
11 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,36 @@
pub use std::*;
mod table;
mod shim;
mod alloc;
pub mod hash_map;
pub mod hash_set;
pub mod fake;
use std::{error, fmt};
trait Recover<Q: ?Sized> {
type Key;
fn get(&self, key: &Q) -> Option<&Self::Key>;
fn take(&mut self, key: &Q) -> Option<Self::Key>;
fn replace(&mut self, key: Self::Key) -> Option<Self::Key>;
}
#[derive(Debug)]
pub struct FailedAllocationError {
reason: &'static str,
}
impl error::Error for FailedAllocationError {
fn description(&self) -> &str {
self.reason
}
}
impl fmt::Display for FailedAllocationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.reason.fmt(f)
}
}