Closed heroin-moose closed 2 years ago
This may or may not be difficult to fix. I'll see if I was too strict with that bound and can reduce it to make this code work.
I cut 0.1.6 to fix this issue.
I pushed an update to https://github.com/kurtbuilds/ormlite-issue that demos the fix.
Unfortunately, AsRef
async fn get<'a>(pool: &SqlitePool, name: impl AsRef<str> + sqlx::Encode<'a, sqlx::Sqlite> + Send + Sync + sqlx::Type<sqlx::Sqlite> + 'a) -> Result<Example>
You can of course name this collection of traits if you find yourself reusing it frequently. I'd like to find a better long term solution, whether thats exporting such trait groupings from ormlite, or finding a way to reduce the number of traits required altogether.
The following example fails to compile:
The error:
However, changing
name.as_ref()
intoname.as_ref().to_string()
fixes it.