Skip to content

Commit f7892af

Browse files
committed
Bump version, fix clippy lint
1 parent c1b0944 commit f7892af

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pruning_radix_trie"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2021"
55
authors = ["Peter Allwin <[email protected]>"]
66
repository = "https://github.com/peterall/pruning_radix_trie.git"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn add(&mut self, term: &str, payload: T, weight: U);
99
After which you can prefix match with:
1010
```rust
1111
pub fn find(&self, prefix: &str, top_k: usize)
12-
-> Vec<(String, &T, &U)>
12+
-> Vec<Result<T,U>>
1313
```
1414
Results are returned in descending order based on weight.
1515

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ where
112112
U: Ord + Copy + Add<Output = U> + Debug,
113113
{
114114
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
115-
other.weight.partial_cmp(self.weight)
115+
Some(self.cmp(other))
116116
}
117117
}
118118

@@ -767,7 +767,7 @@ mod tests {
767767

768768
let buf_reader = BufReader::new(terms_file);
769769

770-
for line in buf_reader.lines().flatten() {
770+
for line in buf_reader.lines().map_while(std::io::Result::ok) {
771771
if let Some((term, freq)) = line.split_once('\t') {
772772
if let Ok(freq) = freq.parse::<u32>() {
773773
trie.add(term, (), freq);

0 commit comments

Comments
 (0)