Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FromSql vs TryFrom / ToSql vs TryInto #1444

Open
gwenn opened this issue Jan 28, 2024 · 1 comment
Open

FromSql vs TryFrom / ToSql vs TryInto #1444

gwenn opened this issue Jan 28, 2024 · 1 comment
Labels

Comments

@gwenn
Copy link
Collaborator

gwenn commented Jan 28, 2024

rusqlite::types::ToSql
vs
std::convert::TryInto

rusqlite::types::FromSql
vs
std::convert::TryFrom

TryInto / TryFrom didn't exist (or at least were not stable) when ToSql / FromSql were created.
But now, is it possible / good to use the standard traits instead ?

@gwenn gwenn added the proposal label Jan 28, 2024
@thomcc
Copy link
Member

thomcc commented Jan 31, 2024

I think it's worth keeping the existing traits, but perhaps it'd be good to experiment?

Notably, in the stdlib we don't see TryFrom<&str> as a replacement for the FromStr trait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants