Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

term_freq in TermFrequencyRecorder untested #2286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/postings/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@
}
doc_id_and_tf.sort_unstable_by_key(|&(doc_id, _)| doc_id);

for (doc_id, tf) in doc_id_and_tf {

Check warning on line 215 in src/postings/recorder.rs

View workflow job for this annotation

GitHub Actions / clippy

unused variable: `tf`

warning: unused variable: `tf` --> src/postings/recorder.rs:215:26 | 215 | for (doc_id, tf) in doc_id_and_tf { | ^^ help: if this is intentional, prefix it with an underscore: `_tf` | = note: `#[warn(unused_variables)]` on by default
serializer.write_doc(doc_id, tf, &[][..]);
serializer.write_doc(doc_id, 0, &[][..]);
}
} else {
let mut prev_doc = 0;
while let Some(delta_doc_id) = u32_it.next() {
let doc_id = prev_doc + delta_doc_id;
prev_doc = doc_id;
let term_freq = u32_it.next().unwrap_or(self.current_tf);

Check warning on line 223 in src/postings/recorder.rs

View workflow job for this annotation

GitHub Actions / clippy

unused variable: `term_freq`

warning: unused variable: `term_freq` --> src/postings/recorder.rs:223:21 | 223 | let term_freq = u32_it.next().unwrap_or(self.current_tf); | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_term_freq`
serializer.write_doc(doc_id, term_freq, &[][..]);
serializer.write_doc(doc_id, 0, &[][..]);
}
}
}
Expand Down
Loading