Skip to content

Commit

Permalink
ci: fix clippy
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi committed May 31, 2024
1 parent 88f5040 commit 1bd1115
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct RecordMat {
idf: f32,
}

#[allow(clippy::too_many_arguments)]
#[pgrx::pg_extern(strict, parallel_safe)]
pub fn bm25_document_to_svector_internal(
mat: pgrx::pg_sys::Oid,
Expand Down Expand Up @@ -110,7 +111,7 @@ pub fn bm25_document_to_svector_internal(
let mut result = "{".to_string();
for (index, value) in x.into_iter() {
let value = value as f32 / (value as f32 + k1 * ((1.0 - b) + b * (length / avgdl)));
result.push_str(&format!("{}:{value}, ", index + 0));
result.push_str(&format!("{}:{value}, ", index));
}
if result.ends_with(", ") {
result.pop();
Expand Down Expand Up @@ -200,7 +201,7 @@ pub fn bm25_query_to_svector_internal(
let sum = x.values().copied().sum::<f32>();
let mut result = "{".to_string();
for (index, value) in x.into_iter() {
result.push_str(&format!("{}:{}, ", index + 0, value / sum));
result.push_str(&format!("{}:{}, ", index, value / sum));
}
if result.ends_with(", ") {
result.pop();
Expand Down

0 comments on commit 1bd1115

Please sign in to comment.