Remove unnecessary with_element_id calls

This commit is contained in:
Nathan Sobo 2023-11-14 01:38:13 -07:00
parent a5306c2312
commit be18c47912

View file

@ -746,13 +746,11 @@ where
f: impl FnOnce(Style, &mut ViewContext<V>) -> LayoutId,
) -> LayoutId {
let style = self.compute_style(None, element_state, cx);
cx.with_element_id(self.element_id.clone(), |cx| {
cx.with_key_dispatch(
self.key_context.clone(),
self.tracked_focus_handle.clone(),
|_, cx| f(style, cx),
)
})
}
pub fn paint(
@ -1037,7 +1035,6 @@ where
.as_ref()
.map(|scroll_offset| *scroll_offset.lock());
cx.with_element_id(self.element_id.clone(), |cx| {
cx.with_key_dispatch(
self.key_context.clone(),
element_state.focus_handle.clone(),
@ -1070,7 +1067,6 @@ where
f(style, scroll_offset.unwrap_or_default(), cx)
},
);
});
if let Some(group) = self.group.as_ref() {
GroupBounds::pop(group, cx);