You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't really understand why ToConnection is an empty trait that requires connection_like::ToConnection to be implemented.
// src/lib.rs:575-584/// Everything that is a connection.////// Note that you could obtain a `'static` connection by giving away `Conn` or `Pool`.pubtraitToConnection<'a,'t:'a>:crate::connection_like::ToConnection<'a,'t>{}// explicitly implemented because of rusdocimpl<'a>ToConnection<'a,'static>for&'a crate::Pool{}impl<'a>ToConnection<'static,'static>forcrate::Pool{}implToConnection<'static,'static>forcrate::Conn{}impl<'a>ToConnection<'a,'static>for&'a mutcrate::Conn{}impl<'a,'t>ToConnection<'a,'t>for&'a mutcrate::Transaction<'t>{}
Because connection_like is a private module it is impossible for anyone to add additional implementations for ToConnection.
One usecase for that would be a simple wrapper type, e.g. to distinguish between 2 different databses.
I can see 2 fixes for this. One is to simply make the connection_like module pub or at least the ToConnection trait.
The second solution would be to replace the above code with a simple reexport. I personally don't see why there need to be 2 different traits, but maybe I'm missing something.
The text was updated successfully, but these errors were encountered:
I don't really understand why
ToConnection
is an empty trait that requiresconnection_like::ToConnection
to be implemented.Because
connection_like
is a private module it is impossible for anyone to add additional implementations forToConnection
.One usecase for that would be a simple wrapper type, e.g. to distinguish between 2 different databses.
I can see 2 fixes for this. One is to simply make the
connection_like
modulepub
or at least theToConnection
trait.The second solution would be to replace the above code with a simple reexport. I personally don't see why there need to be 2 different traits, but maybe I'm missing something.
The text was updated successfully, but these errors were encountered: