Store AnyViewHandle inside ViewHandle and Deref to it
This commit is contained in:
parent
59fb4b3d29
commit
82a713fd1d
32 changed files with 154 additions and 204 deletions
|
@ -602,16 +602,16 @@ impl Item for ProjectDiagnosticsEditor {
|
|||
))
|
||||
}
|
||||
|
||||
fn act_as_type(
|
||||
&self,
|
||||
fn act_as_type<'a>(
|
||||
&'a self,
|
||||
type_id: TypeId,
|
||||
self_handle: &ViewHandle<Self>,
|
||||
_: &AppContext,
|
||||
) -> Option<AnyViewHandle> {
|
||||
self_handle: &'a ViewHandle<Self>,
|
||||
_: &'a AppContext,
|
||||
) -> Option<&AnyViewHandle> {
|
||||
if type_id == TypeId::of::<Self>() {
|
||||
Some(self_handle.into())
|
||||
Some(self_handle)
|
||||
} else if type_id == TypeId::of::<Editor>() {
|
||||
Some((&self.editor).into())
|
||||
Some(&self.editor)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue