Skip to content

Commit

Permalink
Fix for upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Mar 25, 2015
1 parent 271ccc2 commit eabadcf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions phf/src/map.rs
Expand Up @@ -34,10 +34,10 @@ impl<K, V> fmt::Debug for Map<K, V> where K: fmt::Debug, V: fmt::Debug {
}
}

impl<K, V, T: ?Sized> Index<T> for Map<K, V> where T: Eq + PhfHash, K: Borrow<T> {
impl<'a, K, V, T: ?Sized> Index<&'a T> for Map<K, V> where T: Eq + PhfHash, K: Borrow<T> {
type Output = V;

fn index(&self, k: &T) -> &V {
fn index(&self, k: &'a T) -> &V {
self.get(k).expect("invalid key")
}
}
Expand Down
4 changes: 2 additions & 2 deletions phf/src/ordered_map.rs
Expand Up @@ -40,10 +40,10 @@ impl<K, V> fmt::Debug for OrderedMap<K, V> where K: fmt::Debug, V: fmt::Debug {
}
}

impl<K, V, T: ?Sized> Index<T> for OrderedMap<K, V> where T: Eq + PhfHash, K: Borrow<T> {
impl<'a, K, V, T: ?Sized> Index<&'a T> for OrderedMap<K, V> where T: Eq + PhfHash, K: Borrow<T> {
type Output = V;

fn index(&self, k: &T) -> &V {
fn index(&self, k: &'a T) -> &V {
self.get(k).expect("invalid key")
}
}
Expand Down
1 change: 1 addition & 0 deletions phf_codegen/src/lib.rs
Expand Up @@ -10,6 +10,7 @@
//! build.rs
//!
//! ```rust,no_run
//! #![feature(std_misc)]
//! extern crate phf_codegen;
//!
//! use std::fs::File;
Expand Down
14 changes: 6 additions & 8 deletions phf_codegen/test/src/lib.rs
@@ -1,5 +1,3 @@
#![cfg_attr(test, feature(core))]

extern crate phf;

#[cfg(test)]
Expand All @@ -8,9 +6,9 @@ mod test {

#[test]
fn map() {
assert_eq!("a", MAP[1]);
assert_eq!("b", MAP[2]);
assert_eq!("c", MAP[3]);
assert_eq!("a", MAP[&1]);
assert_eq!("b", MAP[&2]);
assert_eq!("c", MAP[&3]);
assert!(!MAP.contains_key(&100));
}

Expand All @@ -24,9 +22,9 @@ mod test {

#[test]
fn ordered_map() {
assert_eq!("a", ORDERED_MAP[1]);
assert_eq!("b", ORDERED_MAP[2]);
assert_eq!("c", ORDERED_MAP[3]);
assert_eq!("a", ORDERED_MAP[&1]);
assert_eq!("b", ORDERED_MAP[&2]);
assert_eq!("c", ORDERED_MAP[&3]);
assert!(!ORDERED_MAP.contains_key(&100));
assert_eq!(&["a", "b", "c"][..], ORDERED_MAP.values().cloned().collect::<Vec<_>>());
}
Expand Down
4 changes: 2 additions & 2 deletions phf_macros/src/lib.rs
Expand Up @@ -3,7 +3,7 @@
//! # Example
//!
//! ```rust
//! #![feature(plugin)]
//! #![feature(plugin, core)]
//! #![plugin(phf_macros)]
//!
//! extern crate phf;
Expand Down Expand Up @@ -31,7 +31,7 @@
//! # fn main() {}
//! ```
#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")]
#![feature(plugin_registrar, quote, rustc_private, std_misc)]
#![feature(plugin_registrar, quote, rustc_private)]

extern crate syntax;
#[cfg(feature = "stats")]
Expand Down
1 change: 0 additions & 1 deletion phf_shared/src/lib.rs
@@ -1,4 +1,3 @@
#![feature(hash)]
#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")]

use std::hash::{Hasher, Hash, SipHasher};
Expand Down

0 comments on commit eabadcf

Please sign in to comment.