pub fn bonus_for(&self, item: &SourceItem, score: Score, indices: &[usize]) -> Score {
        // Ignore the long line.
        if item.raw.len() > 1024 {
            return 0;
        }

        match self {
            Bonus::FileName => bonus_for_filename(item, score, indices),
            Bonus::RecentFiles(recent_files) => recent_files.calc_bonus(item, score),
            Bonus::Language(language) => language.calc_bonus(item, score),
            Bonus::None => 0,
        }
    }
/// Calculates the bonus score given the match result of base algorithm.
Calculates the bonus score given the match result of base algorithm.
Calculates the bonus score given the match result of base algorithm .
pub fn bonus_for(&self, item: &SourceItem, score: Score, indices: &[usize]) -> Score {
        // Ignore the long line.
        if item.raw.len() > 1024 {
            return 0;
        }
        match self {
            Bonus::FileName => bonus_for_filename(item, score, indices),
            Bonus::RecentFiles(recent_files) => recent_files.calc_bonus(item, score),
            Bonus::Language(language) => language.calc_bonus(item, score),
            Bonus::None => 0,
        }
    }
pub fn bonus_for ( & self , item : & SourceItem , score : Score , indices : & [ usize ] ) -> Score { // Ignore the long line. if item . raw . len ( ) > 1024 { return 0 ; } match self { Bonus :: FileName => bonus_for_filename ( item , score , indices ) , Bonus :: RecentFiles ( recent_files ) => recent_files . calc_bonus ( item , score ) , Bonus :: Language ( language ) => language . calc_bonus ( item , score ) , Bonus :: None => 0 , } }
Calculates the bonus score given the match result of base algorithm.
Calculates the bonus score given the match result of base algorithm .
&self
item
&SourceItem
score
Score
indices
&[usize]