Initial code structure for regular links.

This commit is contained in:
Tom Alexander 2023-04-23 16:17:52 -04:00
parent f1bd7f2d1b
commit 3600f46e3b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 21 additions and 5 deletions

View File

@ -1071,13 +1071,23 @@ fn compare_strike_through<'s>(
}
fn compare_regular_link<'s>(
_source: &'s str,
_emacs: &'s Token<'s>,
_rust: &'s RegularLink<'s>,
source: &'s str,
emacs: &'s Token<'s>,
rust: &'s RegularLink<'s>,
) -> Result<DiffResult, Box<dyn std::error::Error>> {
let mut this_status = DiffStatus::Good;
let emacs_name = "link";
if assert_name(emacs, emacs_name).is_err() {
this_status = DiffStatus::Bad;
}
if assert_bounds(source, emacs, rust).is_err() {
this_status = DiffStatus::Bad;
}
Ok(DiffResult {
status: DiffStatus::Good,
name: "regular-link".to_owned(),
status: this_status,
name: emacs_name.to_owned(),
message: None,
children: Vec::new(),
})

View File

@ -111,3 +111,9 @@ impl<'s> Source<'s> for Verbatim<'s> {
self.source
}
}
impl<'s> Source<'s> for RegularLink<'s> {
fn get_source(&'s self) -> &'s str {
self.source
}
}