Skip to content

web search done right

'new()' wasn't used as the term distance scorers are unit structs

Mikkel Denker5cdfaaac3f19
diff --git a/crates/core/src/ranking/pipeline/scorers/term_distance.rs b/crates/core/src/ranking/pipeline/scorers/term_distance.rs
index 16633cbd..fe8eb0e7 100644
--- a/crates/core/src/ranking/pipeline/scorers/term_distance.rs
+++ b/crates/core/src/ranking/pipeline/scorers/term_distance.rs
@@ -55,12 +55,6 @@ fn min_slop<'a>(positions: impl Iterator<Item = &'a [u32]>) -> u32 {
#[derive(Debug, Default)]
pub struct TitleDistanceScorer;
-impl TitleDistanceScorer {
- pub fn new() -> Self {
- Self
- }
-}
-
impl<W: RankableWebpage> super::Scorer<W> for TitleDistanceScorer {
fn score(&self, webpages: &mut [W]) {
for webpage in webpages {
@@ -77,12 +71,6 @@ impl<W: RankableWebpage> super::Scorer<W> for TitleDistanceScorer {
#[derive(Debug, Default)]
pub struct BodyDistanceScorer;
-impl BodyDistanceScorer {
- pub fn new() -> Self {
- Self
- }
-}
-
impl<W: RankableWebpage> super::Scorer<W> for BodyDistanceScorer {
fn score(&self, webpages: &mut [W]) {
for webpage in webpages {