Skip to content

Commit 43e5574

Browse files
committed
Improve documents
1 parent 9450601 commit 43e5574

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ To use `fasthash`, first add this to your `Cargo.toml`:
1010
fasthash = "0.2"
1111
```
1212

13-
When use `fasthash` 128bit supports in Rust 1.15 (beta) or early, we need enable `i128` feature
13+
When use `fasthash` 128bit supports in Rust 1.15 (beta) or earlier version, we need enable `i128` feature.
1414

1515
```toml
1616
[dependencies.fasthash]
1717
version = "0.2"
1818
features = ["i128", "sse42"]
1919
```
2020

21-
Then, add this to your crate root:
21+
Then, add this to your crate root
2222

2323
```rust
2424
extern crate fasthash;
@@ -32,7 +32,13 @@ And then, use hash function with module or hasher
3232
let h = city::hash64("hello world");
3333
```
3434

35+
Or work with `std::hash::Hash`
36+
3537
```rust
38+
use std::hash::Hash;
39+
40+
use fasthash::MetroHasher;
41+
3642
fn hash<T: Hash>(t: &T) -> u64 {
3743
let mut s = MetroHasher::new();
3844
t.hash(&mut s);
@@ -42,7 +48,7 @@ fn hash<T: Hash>(t: &T) -> u64 {
4248
hash(&"hello world");
4349
```
4450

45-
It also cowork with `HashMap` or `HashSet`, act as a hash function
51+
It also works with `HashMap` or `HashSet`, act as the hash function
4652

4753
```rust
4854
use std::collections::HashSet;
@@ -56,7 +62,6 @@ set.insert(2);
5662
Or use RandomState<CityHash64> with a random seed.
5763

5864
```rust
59-
use std::hash::{Hash, Hasher};
6065
use std::collections::HashMap;
6166

6267
use fasthash::RandomState;
@@ -75,8 +80,8 @@ assert_eq!(map[&37], "c");
7580

7681
# Goal
7782
- High performance
78-
- Zero cost
79-
- Compatibility with libstd
83+
- Zero cost binding
84+
- Compatibility with libstd/libcollection
8085

8186
# Features
8287

0 commit comments

Comments
 (0)