Skip to content

Conversation

@PoignardAzur
Copy link
Contributor

@PoignardAzur PoignardAzur commented Jan 27, 2025

This is a showcase-only PR and isn't meant to be merged. This PR tries to show how the soon-to-be stabilized arbitrary_self_types will impact Masonry's codebase.

Note that it's a quick-and-dirty port; there's a ton of places in the code that end up calling Foobar::method(&mut foobar, ...) that could easily be refactored to foobar.method(...), I just didn't take the time to refactor them all.

@PoignardAzur
Copy link
Contributor Author

PoignardAzur commented Jan 27, 2025

Here's an example of what the user code ends up looking like:

let mut checkbox = checkbox.downcast::<Checkbox>();
checkbox.set_checked(true);
checkbox.set_text("The quick brown fox jumps over the lazy dog".into());
let mut label = checkbox.label_mut();
label.set_brush(PRIMARY_LIGHT);
label.insert_style(StyleProperty::FontSize(20.0));

@PoignardAzur PoignardAzur force-pushed the arbitrary_self_types branch from 387d5ee to 2006cb2 Compare April 30, 2025 14:43
@PoignardAzur PoignardAzur changed the title Use nightly feature arbitrary_self_types DRAFT: Use nightly feature arbitrary_self_types Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants