Return impl IntoElement from RenderOnce::render

This makes it a bit more approachable to implement.

This required converting the state of Component to AnyElement, which
costs an allocation. I'm hoping this will be ok performance-wise now
that AnyElements use bump allocation, but I need to benchmark still.
This commit is contained in:
Nathan Sobo
2024-01-02 10:27:09 -07:00
parent 1b5c8b2b4a
commit 68e7d99219
35 changed files with 74 additions and 183 deletions
+1 -1
View File
@@ -4305,7 +4305,7 @@ impl Element for DisconnectedOverlay {
"Your connection to the remote project has been lost.",
))
.into_any();
(overlay.layout(cx), overlay)
(overlay.request_layout(cx), overlay)
}
fn paint(&mut self, bounds: Bounds<Pixels>, overlay: &mut Self::State, cx: &mut WindowContext) {