Hi,
can I avoid the as-cast in the snippet below?
What is the easiest way to cast a value into a trait object?
struct S;
trait T {}
impl T for S {}
fn cast_as(s: S) -> Box<dyn T> {
Box::new(s) as _
}
/* does not compile
fn cast_into(s: S) -> Box<dyn T> {
Box::new(s).into()
}
/*