Closed criminosis closed 3 years ago
I wanted to write something like:
let ids_from_somewhere = vec![1,2,3]; let converted_ids:Vec<GValue> = ids_from_somewhere .into_iter() .map(|x| x.into()) .collect(); let q = "g.V(ids_of_vertices)"; let params: &[(&str, &dyn ToGValue)] = &[("ids_of_vertices", &converted_ids)]; graph.execute(q, params)//....and so forth
But it kept saying there wasn't an implement of ToGValue for Vec<GValue> which surprised me.
ToGValue
Vec<GValue>
Adding this:
impl ToGValue for Vec<GValue> { fn to_gvalue(&self) -> GValue { GValue::List(List::new(self.clone())) } }
to conversion.rs addressed that issue and it seems to work, but I wondered if this omission was intentional? Otherwise I'd like to open a PR to add it.
conversion.rs
Hi @criminosis i guess it's not intentional, It make sense to have it. I PR is more than welcome :)
I wanted to write something like:
But it kept saying there wasn't an implement of
ToGValue
forVec<GValue>
which surprised me.Adding this:
to
conversion.rs
addressed that issue and it seems to work, but I wondered if this omission was intentional? Otherwise I'd like to open a PR to add it.