Verify the trait impl compiles via a generic function.
(c: &C, q: &[f32], v: &[f32])
| 216 | |
| 217 | /// Verify the trait impl compiles via a generic function. |
| 218 | fn use_vector_codec<C: VectorCodec>(c: &C, q: &[f32], v: &[f32]) -> f32 { |
| 219 | let qv = c.encode(v); |
| 220 | let qq = c.prepare_query(q); |
| 221 | c.fast_symmetric_distance(&qv, &qv) + c.exact_asymmetric_distance(&qq, &qv) |
| 222 | } |
| 223 | |
| 224 | #[test] |
| 225 | fn trait_bounds_compile() { |