blob: 074fadfc6c6891ac72522c9efdac50c84f4e7c64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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)
}
}
|