Apply the link templates.

This commit is contained in:
Tom Alexander
2023-10-06 22:08:26 -04:00
parent 2ba5156ee1
commit 4c8828b91b
8 changed files with 203 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
use std::borrow::Cow;
use std::ops::RangeBounds;
use nom::Compare;
@@ -184,6 +185,18 @@ impl<'s> From<OrgSource<'s>> for &'s str {
}
}
impl<'s> From<&OrgSource<'s>> for Cow<'s, str> {
fn from(value: &OrgSource<'s>) -> Self {
(&value.full_source[value.start..value.end]).into()
}
}
impl<'s> From<OrgSource<'s>> for Cow<'s, str> {
fn from(value: OrgSource<'s>) -> Self {
(&value.full_source[value.start..value.end]).into()
}
}
impl<'s, R> Slice<R> for OrgSource<'s>
where
R: RangeBounds<usize>,