use std::borrow::Cow; pub trait InterlinkSolver { fn link_title<'n>(&self, name: &'n str) -> Cow<'n, str>; fn link_location<'n>(&self, name: &'n str) -> Cow<'n, str>; } pub struct EchoInterlinkSolver; impl InterlinkSolver for EchoInterlinkSolver { fn link_title<'n>(&self, name: &'n str) -> Cow<'n, str> { Cow::Borrowed(name) } fn link_location<'n>(&self, name: &'n str) -> Cow<'n, str> { Cow::Borrowed(name) } }