Replies: 5 comments 23 replies
-
You can use |
Beta Was this translation helpful? Give feedback.
-
Good to know that this is expected. It is my deliberate choice to use master for two reasons:
I'm fully aware that by doing that I need to deal with changing APIs. But I'd need to do that too if I would use 1.X releases and then migrate to 2.0 once it's released but without the possibility to migrate gradually and without being able to understand the changes before they are released and therefore stable.
That is my feeling too.
I'll try to find solutions for the existing
Thanks for the clarification. If that's a deliberate choice then this is perfectly fine for me. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this clarification ❤️. Such feedback on API changes is always welcome. |
Beta Was this translation helpful? Give feedback.
-
What is the recommended way to write a generic implementation of I have a lot of code like #[diesel(sql_type = diesel::sql_types::SmallInt)]
pub enum FileType {
SSTATE = 1,
SOURCE = 2,
SCM = 3,
CICACHE = 4,
}
impl <DB> ToSql<SmallInt, DB> for FileType
where
DB: Backend,
i16: ToSql<SmallInt, DB>
{
fn to_sql<W: Write>(&self, out: &mut Output<W, DB>) -> SerResult {
(*self as i16).to_sql(out)
}
} Changing this to new api does not seem to be trivial (the "Beside of the changed signature, existing impls of this trait should remain unchanged in almost all cases" in the ChangeLog definitively does not hold ;) |
Beta Was this translation helpful? Give feedback.
-
Thanks to all here for the information, I was totally lost when I updated my target commit. |
Beta Was this translation helpful? Give feedback.
-
As of #2931, we often can't delegate
ToSql
implementations to existing implementations anymore, e.g.:(playground)
I'm wondering whether we'd like to do something to allow it, like this:
(playground)
or like this:
(playground)
Workaround
My current workaround is to copy-paste from the Diesel implementation:EDIT: If backend's
BindCollector
isRawBytesBindCollector
, usingreborrow
works:Beta Was this translation helpful? Give feedback.
All reactions