# Add downcast_ref to AnyViewHandle · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/138aa0492a1277b2d426cb02cfa881a494080180)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 138aa0492a1277b2d426cb02cfa881a494080180

Requested commit: 138aa0492a1277b2d426cb02cfa881a494080180

Commit: 138aa0492a1277b2d426cb02cfa881a494080180

Tree: 9cd53d3caa341865d7cca366fee4f2e6327588fa

Author: Nathan Sobo

Committer: Nathan Sobo

## Message

```
Add downcast_ref to AnyViewHandle

I use unsafe code to transmute an AnyViewHandle to a ViewHandle<T> when
the type matches. Because ViewHandle<T> is repr(transparent) to the
wrapped AnyViewHandle, this is safe.

```

## Parents

- [71cf6ec5ae9487156924fb787aead20cd464a022](https://git.cafe/gitcafe/zed/commit/71cf6ec5ae9487156924fb787aead20cd464a022?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/138aa0492a1277b2d426cb02cfa881a494080180?format=markdown)
