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 had originally wanted to returned owned values here because I'm
thinking that when we eventually add support for composite primary keys,
I'll need to return a tuple of two fields from this method. I've gone
back and forth on a bunch of different options, but ultimately I think
I'm going to change this to return `Cow<'a, Self::Id>`. However, I don't
want to make that change pre-emptively, as I'm still not sure exactly
what composite primary keys will look like.
Other alternatives:
- Implement `Identifiable` on `&'a T` -- makes reasoning about it a pain
- Change `Identifiable` to be `Identifiable<'a>` -- makes referencing it
a pain
- Change `id` to `with_id`, and have it take a `FnOnce(&Self::Id)`. This
would work, but would be really weird and just returning `Cow<'a,
Self::Id>` makes way more sense.
0 commit comments