How do I call a function that expects a trait object if I have a Box<T>
instead? In other words:
trait T { ... }
fn func(t: &T) { ... }
fn some_other_func() {
b: Box<T>; // Provided
// These work, but is there a better way?
func( &*b ); // 1
func( Borrow::borrow(&b) ); // 2
}
Both 1 and 2 seem wrong. Am I missing something obvious?