-
Notifications
You must be signed in to change notification settings - Fork 88
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
Remove dependency on smallvec and set MSRV of 1.75 #253
Comments
I want to note, that RPITIT prevents trait-objects (more specifically |
How so?
Overall I'm... mostly confident we're never going to bump into the problems that link mentions? Right now SmallVec is used to get a list of children, and that list is virtually always going to be either iterated through immediately, or stored as a collection. There reason I used SmallVec is that a lot of widgets return a children list with a size of one. But returning |
See https://doc.rust-lang.org/beta/reference/items/traits.html#object-safety
Probably, main issue is mostly trait object safety for I'm not yet that confident in the masonry codebase, but is it even necessary to have |
Oh, right, the Widget trait is the one that would have a generic method. Well, there would be ways to implement it and preserve dyn-safety, but I do agree that complicates things a bit.
Yup. This means that the framework can eg take a position and return a reference to the Widget at that position without having to write code in WidgetPod. It's also useful for debugging, building the accessibility tree, and in the future the event system will rely on it a lot more. Having |
Smallvec in Masonry was always intended to be a placeholder until return-position impl Trait was stabilized. Well, now it's stable, it's been stable for a year, we should use it.
Methods that return
Smallvec<T>
should instead returnimpl Iterator<Item = T>
. The MSRV of Masonry and xilem_masonry should be set to reflect that.EDIT: Complicated by the fact that we need Widget to be dyn-safe. Might need to be postponed.
The text was updated successfully, but these errors were encountered: