mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 22:34:13 +00:00
Fix confusing error message
This commit is contained in:
parent
3a72f2122a
commit
b804b25c21
2 changed files with 8 additions and 4 deletions
|
@ -134,7 +134,10 @@ where
|
||||||
.layout(state, frame_state.as_mut().unwrap(), cx);
|
.layout(state, frame_state.as_mut().unwrap(), cx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => panic!("must call initialize before layout"),
|
ElementRenderPhase::Start => panic!("must call initialize before layout"),
|
||||||
|
ElementRenderPhase::LayoutRequested { .. } | ElementRenderPhase::Painted => {
|
||||||
|
panic!("element rendered twice")
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.phase = ElementRenderPhase::LayoutRequested {
|
self.phase = ElementRenderPhase::LayoutRequested {
|
||||||
|
|
|
@ -397,9 +397,10 @@ pub trait ElementInteraction<V: 'static>: 'static {
|
||||||
None
|
None
|
||||||
}),
|
}),
|
||||||
));
|
));
|
||||||
let result = stateful.stateless.initialize(cx, f);
|
|
||||||
stateful.key_listeners.pop();
|
cx.with_key_dispatch_context(stateful.dispatch_context.clone(), |cx| {
|
||||||
result
|
cx.with_key_listeners(mem::take(&mut stateful.key_listeners), f)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let stateless = self.as_stateless_mut();
|
let stateless = self.as_stateless_mut();
|
||||||
|
|
Loading…
Reference in a new issue