Skip to content

Commit

Permalink
Fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jun 17, 2021
1 parent ddecc3a commit 9adc370
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 22 deletions.
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -72,8 +72,6 @@ phf_codegen
build.rs

```rust
extern crate phf_codegen;

use std::env;
use std::fs::File;
use std::io::{BufWriter, Write};
Expand All @@ -99,8 +97,6 @@ fn main() {
lib.rs

```rust
extern crate phf;

#[derive(Clone)]
enum Keyword {
Loop,
Expand Down
6 changes: 3 additions & 3 deletions phf/src/map.rs
Expand Up @@ -94,21 +94,21 @@ impl<K, V> Map<K, V> {
/// Returns an iterator over the key/value pairs in the map.
///
/// Entries are returned in an arbitrary but fixed order.
pub fn entries<'a>(&'a self) -> Entries<'a, K, V> {
pub fn entries(&self) -> Entries<K, V> {
Entries { iter: self.entries.iter() }
}

/// Returns an iterator over the keys in the map.
///
/// Keys are returned in an arbitrary but fixed order.
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
pub fn keys(&self) -> Keys<K, V> {
Keys { iter: self.entries() }
}

/// Returns an iterator over the values in the map.
///
/// Values are returned in an arbitrary but fixed order.
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
pub fn values(&self) -> Values<K, V> {
Values { iter: self.entries() }
}
}
Expand Down
6 changes: 3 additions & 3 deletions phf/src/ordered_map.rs
Expand Up @@ -124,21 +124,21 @@ impl<K, V> OrderedMap<K, V> {
/// Returns an iterator over the key/value pairs in the map.
///
/// Entries are returned in the same order in which they were defined.
pub fn entries<'a>(&'a self) -> Entries<'a, K, V> {
pub fn entries(&self) -> Entries<K, V> {
Entries { iter: self.entries.iter() }
}

/// Returns an iterator over the keys in the map.
///
/// Keys are returned in the same order in which they were defined.
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
pub fn keys(&self) -> Keys<K, V> {
Keys { iter: self.entries() }
}

/// Returns an iterator over the values in the map.
///
/// Values are returned in the same order in which they were defined.
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
pub fn values(&self) -> Values<K, V> {
Values { iter: self.entries() }
}
}
Expand Down
2 changes: 1 addition & 1 deletion phf/src/ordered_set.rs
Expand Up @@ -73,7 +73,7 @@ impl<T> OrderedSet<T> {
/// Returns an iterator over the values in the set.
///
/// Values are returned in the same order in which they were defined.
pub fn iter<'a>(&'a self) -> Iter<'a, T> {
pub fn iter(&self) -> Iter<T> {
Iter { iter: self.map.keys() }
}
}
Expand Down
2 changes: 1 addition & 1 deletion phf/src/set.rs
Expand Up @@ -57,7 +57,7 @@ impl<T> Set<T> {
/// Returns an iterator over the values in the set.
///
/// Values are returned in an arbitrary but fixed order.
pub fn iter<'a>(&'a self) -> Iter<'a, T> {
pub fn iter(&self) -> Iter<T> {
Iter { iter: self.map.keys() }
}
}
Expand Down
3 changes: 0 additions & 3 deletions phf_codegen/test/build.rs
@@ -1,6 +1,3 @@
extern crate phf_codegen;
extern crate unicase;

use std::env;
use std::fs::File;
use std::io::{self, BufWriter, Write};
Expand Down
8 changes: 1 addition & 7 deletions phf_shared/src/lib.rs
Expand Up @@ -4,21 +4,16 @@
#[cfg(feature = "std")]
extern crate std as core;

extern crate siphasher;

#[cfg(feature = "unicase")]
extern crate unicase;

use core::fmt;
use core::hash::{Hasher, Hash};
use core::num::Wrapping;
use siphasher::sip128::{Hash128, Hasher128, SipHasher13};

#[non_exhaustive]
pub struct Hashes {
pub g: u32,
pub f1: u32,
pub f2: u32,
_priv: (),
}

/// A central typedef for hash keys
Expand All @@ -43,7 +38,6 @@ pub fn hash<T: ?Sized + PhfHash>(x: &T, key: &HashKey) -> Hashes {
g: (lower >> 32) as u32,
f1: lower as u32,
f2: upper as u32,
_priv: (),
}
}

Expand Down

0 comments on commit 9adc370

Please sign in to comment.