diff options
author | Teddy Wing | 2022-03-19 04:06:15 +0100 |
---|---|---|
committer | Teddy Wing | 2022-03-19 04:06:15 +0100 |
commit | 1b467a73e02c89b4b6b63957d6f68c620c6fcb44 (patch) | |
tree | 00641f551aa7f62ccfef460e286b783ad66560ff /src/lib.rs | |
parent | d78addd46aa7633346c47dd310c972ef0e9029fa (diff) | |
download | yaqlite-1b467a73e02c89b4b6b63957d6f68c620c6fcb44.tar.bz2 |
select(): Change `column_names` to `Vec<String>`
Change `column_names` from `Vec<yaml_rust::Yaml::String>` to
`Vec<String>`. This way we don't have to clone the `yaml_rust::Yaml`
value to insert into the `yaml_rust::yaml::Hash`.
Had some issues getting this to work. I tried calling
`stmt.column_names()` on its own, but this caused a borrow checker
error, as that creates an immutable borrow, while the `stmt.query_map()`
call is a mutable borrow, and we can't do both.
Found this ticket that describes exactly the problem I was having:
https://github.com/rusqlite/rusqlite/pull/523
Turns out I had the right idea to begin with: I needed to collect the
column names into a `Vec`. But don't use a `Vec` of `yaml_rust::Yaml`
values, because that requires excess cloning.
Diffstat (limited to 'src/lib.rs')
0 files changed, 0 insertions, 0 deletions