Skip to content

Commit

Permalink
format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andthattoo committed Sep 6, 2024
1 parent e9da889 commit 66e46d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/memory/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod arm_compat {
pub trait SimpleSpatialSimilarity {
fn cosine(a: &[f32], b: &[f32]) -> Option<f32>;
}

impl SimpleSpatialSimilarity for f32 {
fn cosine(a: &[f32], b: &[f32]) -> Option<f32> {
if a.len() != b.len() {
Expand Down Expand Up @@ -234,7 +234,7 @@ impl FileSystem {
fn brute_force_top_n(&self, query: &[f32], n: usize) -> Vec<(String, f32)> {
let mut similarities = Vec::new();
for (_, v) in &self.entries {
let similarity = f32::cosine(query, v).unwrap_or(0.0) as f32;
let similarity = f32::cosine(query, v).unwrap_or(0.0);
similarities.push(similarity);
}

Expand Down

0 comments on commit 66e46d2

Please sign in to comment.