AlexPikalov / cdrs

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Apache License 2.0
343 stars 58 forks source link

Into for vec does not work #354

Closed Jasperav closed 3 years ago

Jasperav commented 3 years ago

Copy paste this code inside query_values.rs in the test module:

#[test]
fn vec() {
  let values = vec![1, 2];
  let values_clone = values.clone();

  let qv_direct = cdrs::query_values!(values_clone);
  let mut qv_indirect: Vec<cdrs::types::value::Value> = Vec::new();

  for value in values {
    qv_indirect.push(value.into());
  }
  let qv_indirect = cdrs::query::QueryValues::SimpleValues(qv_indirect);

  assert_eq!(qv_direct, qv_indirect);
}

This fails, but the test should succeed.

Jasperav commented 3 years ago

This can be closed, I was misusing a paramterized in query. They should not be equal, else Cassandra will complain about bindings