I forked the crate timeago and am struggling to use Box<dyn Language>
, as the compiler reports E0038:
the trait
Language
cannot be made into an objectLanguage
cannot be made into an object
I'm trying to modify the Language
trait so that it implements Clone
:
#[allow(missing_docs)]
pub trait Language : Clone {
// ...
}
I removed the following implementation, but the IDE extension is persisting with the above error:
#[cfg_attr(rustfmt, rustfmt_skip)]
impl<L:Language+?Sized> Language for Box<L> {
fn too_low(&self) -> &'static str { (**self).too_low() }
fn too_high(&self) -> &'static str { (**self).too_high() }
fn ago(&self) -> &'static str { (**self).ago() }
fn place_ago_before(&self) -> bool { (**self).place_ago_before() }
fn get_word(&self, tu: TimeUnit, x: u64) -> &'static str {
(**self).get_word(tu, x)
}
}
At this point I just can't try fighting the IDE anymore.