Update README's recommendation of query_map

This commit is contained in:
John Gallagher 2015-05-11 16:44:32 -04:00
parent 51f6c15c6c
commit f65eadbc83

View File

@ -90,9 +90,10 @@ fn bad_function_will_panic(conn: &SqliteConnection) -> SqliteResult<i64> {
There are other, less obvious things that may result in a panic as well, such as calling
`collect()` on a `SqliteRows` and then trying to use the collected rows.
The method `query_map()` is an alternative to `query()` and is guaranteed not to panic. This method
returns an iterator over rows after they have been mapped to a static type, e.g., types without
references to other values.
Strongly consider using the method `query_map()` instead, if you can.
`query_map()` returns an iterator over rows-mapped-to-some-`'static`-type. This
iterator does not have any of the above issues with panics due to attempting to
access stale rows.
## Author