|
|
|
|
|
by K0nserv
158 days ago
|
|
> In c the callers isn’t choosing typically. The author of some library or api decides this for you. Tbf this applies to Rust too. If the author writes fn foo(bar: Box<dyn BarTrait>)
they have forced the caller into dynamic dispatch.Had they written fn foo(bar: impl BarTrait)
the choice would've remained open to the caller |
|