Skip to content

Commit

Permalink
fix sparse vector converter
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay committed Dec 3, 2023
1 parent f5b819b commit 397879e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ impl From<Vec<f32>> for Vector {
}
}

impl From<Vec<(u32, f64)>> for Vector {
fn from(tuples: Vec<(u32, f64)>) -> Self {
impl From<Vec<(u32, f32)>> for Vector {
fn from(tuples: Vec<(u32, f32)>) -> Self {
let mut indices = Vec::with_capacity(tuples.len());
let mut values = Vec::with_capacity(tuples.len());
for (i, w) in tuples {
indices.push(i);
values.push(w as f32);
values.push(w);
}
Vector {
data: values,
Expand Down

0 comments on commit 397879e

Please sign in to comment.