trevyn / turbosql

An easy local data persistence layer for Rust, backed by SQLite.
211 stars 8 forks source link

`select!` shouldn't consume parameters #5

Closed trevyn closed 2 years ago

trevyn commented 3 years ago

This consumes row, but shouldn't:

select!(PersonIntegrationTest "WHERE name = ?", row.name.unwrap())

Workaround:

select!(PersonIntegrationTest "WHERE name = ?", row.clone().name.unwrap())
trevyn commented 2 years ago

This is not a Turbosql bug; the unwrap() is doing the consuming. Use:

select!(PersonIntegrationTest "WHERE name = ?", row.name.as_ref().unwrap())