mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-02 16:40:43 +00:00
Clippy
This commit is contained in:
@@ -69,8 +69,8 @@ pub fn serialize_vint_u32(val: u32) -> (u64, usize) {
|
||||
/// # May Panic
|
||||
/// If the payload does not start by a valid `vint`
|
||||
fn vint_len(data: &[u8]) -> usize {
|
||||
for i in 0..5.min(data.len()) {
|
||||
if data[i] >= STOP_BIT {
|
||||
for (i, &val) in data.iter().enumerate().take(5) {
|
||||
if val >= STOP_BIT {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ impl SegmentComponent {
|
||||
SegmentComponent::STORE,
|
||||
SegmentComponent::DELETE,
|
||||
];
|
||||
SEGMENT_COMPONENTS.into_iter()
|
||||
SEGMENT_COMPONENTS.iter()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ pub fn intersect_scorers(mut scorers: Vec<Box<Scorer>>) -> Box<Scorer> {
|
||||
(Some(single_docset), None) => single_docset,
|
||||
(Some(left), Some(right)) => {
|
||||
{
|
||||
let all_term_scorers = [&left, &right].into_iter().all(|scorer| {
|
||||
let scorer_ref: &Scorer = (*scorer).borrow();
|
||||
let all_term_scorers = [&left, &right].iter().all(|&scorer| {
|
||||
let scorer_ref: &Scorer = <Box<Scorer> as Borrow<Scorer>>::borrow(scorer);
|
||||
Downcast::<TermScorer>::is_type(scorer_ref)
|
||||
});
|
||||
if all_term_scorers {
|
||||
|
||||
@@ -27,9 +27,8 @@ pub enum Language {
|
||||
}
|
||||
|
||||
impl Language {
|
||||
fn algorithm(&self) -> Algorithm {
|
||||
fn algorithm(self) -> Algorithm {
|
||||
use self::Language::*;
|
||||
|
||||
match self {
|
||||
Arabic => Algorithm::Arabic,
|
||||
Danish => Algorithm::Danish,
|
||||
|
||||
Reference in New Issue
Block a user