Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
the_mitsuhiko
8y ago
0 comments
Save
Share
Rust could generate a bespoke internal proxy type.
0 comments
6 comments · 2 top-level
top
newest
oldest
Rusky
8y ago
· 2 in thread
That would still require dynamic dispatch of some kind.
the_mitsuhiko
OP
8y ago
But it wouldn’t require a heap allocation.
lmm
8y ago
Where is the proxy implementation going to go if not the heap?
1 more reply
shepmaster
8y ago
· 2 in thread
Until then, we use `Either` (
https://stackoverflow.com/a/50204370/155423
)
leshow
8y ago
Tangentially, do you know why Rust never included an Either type? We have Result, which is great, but Either is useful for more things than errors (though that seems to be it's main use).
steveklabnik
8y ago
We had it for a long time, as well as result, and literally no code used it, so we took it out.
There’s a crate on crates.io for it if you want to use it for something.
j
/
k
navigate · click thread line to collapse