Closed bicarlsen closed 1 year ago
All builders (I think) are now non-consuming so it's a bit more tricky to do that, we cannot just return Self
from methods, since we borrow &mut self
.
But I'm thinking we can just make the final method take an &self
instead of self
since we never need ownership of the builder anyway 🤔 it just feels a bit weird to have the final method of a builder take &self
but that's alright I guess
Update, it makes total sense for the final methods of each builder to only take immutable references to the builder bc all the js methods have to clone anyway
Looks much more ergonomic now :)
Merged 😄
In thinking about the ergonomics of the library, would it be nice for
Builder
methods -- e.g.FileDialogBuilder.set_default_path
-- to returnself
?This would allow method chaining turning, e.g.
into