From c0555dec0b1fdef2aa2d4fce40bb76bbe46c3dc6 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 2 Oct 2023 12:28:48 -0400 Subject: [PATCH] Fix lifetimes for DiffEntry/DiffResult. --- src/compare/diff.rs | 339 ++++++++++++++++++++++++++------------------ 1 file changed, 203 insertions(+), 136 deletions(-) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 25cf74d..bf3dba2 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -12,6 +12,7 @@ use super::util::get_property; use super::util::get_property_boolean; use super::util::get_property_quoted_string; use super::util::get_property_unquoted_atom; +use crate::iter::AstNode; use crate::types::AngleLink; use crate::types::BabelCall; use crate::types::Bold; @@ -81,20 +82,20 @@ use crate::types::Verbatim; use crate::types::VerseBlock; #[derive(Debug)] -pub enum DiffEntry<'s> { - DiffResult(DiffResult<'s>), - DiffLayer(DiffLayer<'s>), +pub enum DiffEntry<'b, 's> { + DiffResult(DiffResult<'b, 's>), + DiffLayer(DiffLayer<'b, 's>), } #[derive(Debug)] -pub struct DiffResult<'s> { +pub struct DiffResult<'b, 's> { status: DiffStatus, name: Cow<'s, str>, message: Option, - children: Vec>, + children: Vec>, rust_source: &'s str, #[allow(dead_code)] - emacs_token: &'s Token<'s>, + emacs_token: &'b Token<'s>, } #[derive(Debug, PartialEq)] @@ -104,24 +105,24 @@ enum DiffStatus { } #[derive(Debug)] -pub struct DiffLayer<'s> { +pub struct DiffLayer<'b, 's> { name: Cow<'s, str>, - children: Vec>, + children: Vec>, } -impl<'s> From> for DiffEntry<'s> { - fn from(value: DiffResult<'s>) -> Self { +impl<'b, 's> From> for DiffEntry<'b, 's> { + fn from(value: DiffResult<'b, 's>) -> Self { DiffEntry::DiffResult(value) } } -impl<'s> From> for DiffEntry<'s> { - fn from(value: DiffLayer<'s>) -> Self { +impl<'b, 's> From> for DiffEntry<'b, 's> { + fn from(value: DiffLayer<'b, 's>) -> Self { DiffEntry::DiffLayer(value) } } -impl<'s> DiffEntry<'s> { +impl<'b, 's> DiffEntry<'b, 's> { fn has_bad_children(&self) -> bool { match self { DiffEntry::DiffResult(diff) => &diff.children, @@ -158,7 +159,7 @@ impl<'s> DiffEntry<'s> { } } -impl<'s> DiffResult<'s> { +impl<'b, 's> DiffResult<'b, 's> { fn print_indented( &self, indentation: usize, @@ -250,7 +251,7 @@ impl<'s> DiffResult<'s> { } } -impl<'s> DiffLayer<'s> { +impl<'b, 's> DiffLayer<'b, 's> { fn has_bad_children(&self) -> bool { self.children .iter() @@ -288,10 +289,10 @@ impl<'s> DiffLayer<'s> { } } -fn artificial_diff_scope<'s>( +fn artificial_diff_scope<'b, 's>( name: &'static str, - children: Vec>, -) -> Result, Box> { + children: Vec>, +) -> Result, Box> { Ok(DiffLayer { name: name.into(), children, @@ -299,11 +300,77 @@ fn artificial_diff_scope<'s>( .into()) } -fn compare_element<'s>( +fn compare_ast_node<'b, 's>( + source: &'s str, + emacs: &'b Token<'s>, + rust: AstNode<'b, 's>, +) -> Result, Box> { + let compare_result: Result, Box> = match rust { + AstNode::Document(_) => todo!(), + AstNode::Heading(_) => todo!(), + AstNode::Section(_) => todo!(), + AstNode::Paragraph(_) => todo!(), + AstNode::PlainList(_) => todo!(), + AstNode::PlainListItem(_) => todo!(), + AstNode::GreaterBlock(_) => todo!(), + AstNode::DynamicBlock(_) => todo!(), + AstNode::FootnoteDefinition(_) => todo!(), + AstNode::Comment(_) => todo!(), + AstNode::Drawer(_) => todo!(), + AstNode::PropertyDrawer(_) => todo!(), + AstNode::NodeProperty(_) => todo!(), + AstNode::Table(_) => todo!(), + AstNode::TableRow(_) => todo!(), + AstNode::VerseBlock(_) => todo!(), + AstNode::CommentBlock(_) => todo!(), + AstNode::ExampleBlock(_) => todo!(), + AstNode::ExportBlock(_) => todo!(), + AstNode::SrcBlock(_) => todo!(), + AstNode::Clock(_) => todo!(), + AstNode::DiarySexp(_) => todo!(), + AstNode::Planning(_) => todo!(), + AstNode::FixedWidthArea(_) => todo!(), + AstNode::HorizontalRule(_) => todo!(), + AstNode::Keyword(_) => todo!(), + AstNode::BabelCall(_) => todo!(), + AstNode::LatexEnvironment(_) => todo!(), + AstNode::Bold(_) => todo!(), + AstNode::Italic(_) => todo!(), + AstNode::Underline(_) => todo!(), + AstNode::StrikeThrough(_) => todo!(), + AstNode::Code(_) => todo!(), + AstNode::Verbatim(_) => todo!(), + AstNode::PlainText(_) => todo!(), + AstNode::RegularLink(_) => todo!(), + AstNode::RadioLink(_) => todo!(), + AstNode::RadioTarget(_) => todo!(), + AstNode::PlainLink(_) => todo!(), + AstNode::AngleLink(_) => todo!(), + AstNode::OrgMacro(_) => todo!(), + AstNode::Entity(_) => todo!(), + AstNode::LatexFragment(_) => todo!(), + AstNode::ExportSnippet(_) => todo!(), + AstNode::FootnoteReference(_) => todo!(), + AstNode::Citation(_) => todo!(), + AstNode::CitationReference(_) => todo!(), + AstNode::InlineBabelCall(_) => todo!(), + AstNode::InlineSourceBlock(_) => todo!(), + AstNode::LineBreak(_) => todo!(), + AstNode::Target(_) => todo!(), + AstNode::StatisticsCookie(_) => todo!(), + AstNode::Subscript(_) => todo!(), + AstNode::Superscript(_) => todo!(), + AstNode::TableCell(_) => todo!(), + AstNode::Timestamp(node) => compare_timestamp(source, emacs, node), + }; + todo!() +} + +fn compare_element<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Element<'s>, -) -> Result, Box> { +) -> Result, Box> { let compare_result = match rust { Element::Paragraph(obj) => compare_paragraph(source, emacs, obj), Element::PlainList(obj) => compare_plain_list(source, emacs, obj), @@ -357,11 +424,11 @@ fn compare_element<'s>( Ok(compare_result.into()) } -fn compare_object<'s>( +fn compare_object<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Object<'s>, -) -> Result, Box> { +) -> Result, Box> { let compare_result = match rust { Object::Bold(obj) => compare_bold(source, emacs, obj), Object::Italic(obj) => compare_italic(source, emacs, obj), @@ -423,10 +490,10 @@ fn compare_object<'s>( Ok(compare_result.into()) } -pub fn compare_document<'s>( +pub fn compare_document<'b, 's>( emacs: &'s Token<'s>, rust: &'s Document<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -532,11 +599,11 @@ pub fn compare_document<'s>( .into()) } -fn compare_section<'s>( +fn compare_section<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Section<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut this_status = DiffStatus::Good; let mut child_status = Vec::new(); @@ -565,11 +632,11 @@ fn compare_section<'s>( .into()) } -fn compare_heading<'s>( +fn compare_heading<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Heading<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -794,11 +861,11 @@ fn get_tags_from_heading<'s>( Ok(tags) } -fn compare_paragraph<'s>( +fn compare_paragraph<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Paragraph<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -819,11 +886,11 @@ fn compare_paragraph<'s>( .into()) } -fn compare_plain_list<'s>( +fn compare_plain_list<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s PlainList<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -861,11 +928,11 @@ fn compare_plain_list<'s>( .into()) } -fn compare_plain_list_item<'s>( +fn compare_plain_list_item<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s PlainListItem<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -986,11 +1053,11 @@ fn compare_plain_list_item<'s>( .into()) } -fn compare_greater_block<'s>( +fn compare_greater_block<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s GreaterBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -1013,11 +1080,11 @@ fn compare_greater_block<'s>( .into()) } -fn compare_dynamic_block<'s>( +fn compare_dynamic_block<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s DynamicBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -1039,11 +1106,11 @@ fn compare_dynamic_block<'s>( .into()) } -fn compare_footnote_definition<'s>( +fn compare_footnote_definition<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s FootnoteDefinition<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -1065,11 +1132,11 @@ fn compare_footnote_definition<'s>( .into()) } -fn compare_comment<'s>( +fn compare_comment<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Comment<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let this_status = DiffStatus::Good; let message = None; @@ -1086,11 +1153,11 @@ fn compare_comment<'s>( .into()) } -fn compare_drawer<'s>( +fn compare_drawer<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Drawer<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -1112,11 +1179,11 @@ fn compare_drawer<'s>( .into()) } -fn compare_property_drawer<'s>( +fn compare_property_drawer<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s PropertyDrawer<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -1137,11 +1204,11 @@ fn compare_property_drawer<'s>( .into()) } -fn compare_node_property<'s>( +fn compare_node_property<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s NodeProperty<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let mut message = None; @@ -1167,11 +1234,11 @@ fn compare_node_property<'s>( .into()) } -fn compare_table<'s>( +fn compare_table<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s Table<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -1232,11 +1299,11 @@ fn compare_table<'s>( .into()) } -fn compare_table_row<'s>( +fn compare_table_row<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s TableRow<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -1269,11 +1336,11 @@ fn compare_table_row<'s>( .into()) } -fn compare_table_cell<'s>( +fn compare_table_cell<'b, 's>( source: &'s str, emacs: &'s Token<'s>, rust: &'s TableCell<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let child_status = Vec::new(); let mut this_status = DiffStatus::Good; @@ -1300,11 +1367,11 @@ fn compare_table_cell<'s>( .into()) } -fn compare_verse_block<'s>( +fn compare_verse_block<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s VerseBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let children = emacs.as_list()?; let child_status = Vec::new(); let this_status = DiffStatus::Good; @@ -1323,11 +1390,11 @@ fn compare_verse_block<'s>( .into()) } -fn compare_comment_block<'s>( +fn compare_comment_block<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s CommentBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1344,11 +1411,11 @@ fn compare_comment_block<'s>( .into()) } -fn compare_example_block<'s>( +fn compare_example_block<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s ExampleBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1365,11 +1432,11 @@ fn compare_example_block<'s>( .into()) } -fn compare_export_block<'s>( +fn compare_export_block<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s ExportBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1386,11 +1453,11 @@ fn compare_export_block<'s>( .into()) } -fn compare_src_block<'s>( +fn compare_src_block<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s SrcBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1407,11 +1474,11 @@ fn compare_src_block<'s>( .into()) } -fn compare_clock<'s>( +fn compare_clock<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Clock<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1428,11 +1495,11 @@ fn compare_clock<'s>( .into()) } -fn compare_diary_sexp<'s>( +fn compare_diary_sexp<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s DiarySexp<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1449,11 +1516,11 @@ fn compare_diary_sexp<'s>( .into()) } -fn compare_planning<'s>( +fn compare_planning<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Planning<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1470,11 +1537,11 @@ fn compare_planning<'s>( .into()) } -fn compare_fixed_width_area<'s>( +fn compare_fixed_width_area<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s FixedWidthArea<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let this_status = DiffStatus::Good; let message = None; @@ -1492,11 +1559,11 @@ fn compare_fixed_width_area<'s>( .into()) } -fn compare_horizontal_rule<'s>( +fn compare_horizontal_rule<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s HorizontalRule<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let this_status = DiffStatus::Good; let message = None; @@ -1512,11 +1579,11 @@ fn compare_horizontal_rule<'s>( .into()) } -fn compare_keyword<'s>( +fn compare_keyword<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Keyword<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let mut message = None; @@ -1557,11 +1624,11 @@ fn compare_keyword<'s>( .into()) } -fn compare_babel_call<'s>( +fn compare_babel_call<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s BabelCall<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let mut message = None; @@ -1591,11 +1658,11 @@ fn compare_babel_call<'s>( .into()) } -fn compare_latex_environment<'s>( +fn compare_latex_environment<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s LatexEnvironment<'s>, -) -> Result, Box> { +) -> Result, Box> { let child_status = Vec::new(); let this_status = DiffStatus::Good; let message = None; @@ -1613,11 +1680,11 @@ fn compare_latex_environment<'s>( .into()) } -fn compare_plain_text<'s>( +fn compare_plain_text<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s PlainText<'s>, -) -> Result, Box> { +) -> Result, Box> { let mut this_status = DiffStatus::Good; let mut message = None; let rust_source = rust.get_source(); @@ -1663,11 +1730,11 @@ fn compare_plain_text<'s>( .into()) } -fn compare_bold<'s>( +fn compare_bold<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Bold<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1682,11 +1749,11 @@ fn compare_bold<'s>( .into()) } -fn compare_italic<'s>( +fn compare_italic<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Italic<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1701,11 +1768,11 @@ fn compare_italic<'s>( .into()) } -fn compare_underline<'s>( +fn compare_underline<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Underline<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1720,11 +1787,11 @@ fn compare_underline<'s>( .into()) } -fn compare_verbatim<'s>( +fn compare_verbatim<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Verbatim<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1741,11 +1808,11 @@ fn compare_verbatim<'s>( .into()) } -fn compare_code<'s>( +fn compare_code<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Code<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1762,11 +1829,11 @@ fn compare_code<'s>( .into()) } -fn compare_strike_through<'s>( +fn compare_strike_through<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s StrikeThrough<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1781,11 +1848,11 @@ fn compare_strike_through<'s>( .into()) } -fn compare_regular_link<'s>( +fn compare_regular_link<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s RegularLink<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1802,11 +1869,11 @@ fn compare_regular_link<'s>( .into()) } -fn compare_radio_link<'s>( +fn compare_radio_link<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s RadioLink<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1823,11 +1890,11 @@ fn compare_radio_link<'s>( .into()) } -fn compare_radio_target<'s>( +fn compare_radio_target<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s RadioTarget<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1844,11 +1911,11 @@ fn compare_radio_target<'s>( .into()) } -fn compare_plain_link<'s>( +fn compare_plain_link<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s PlainLink<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1865,11 +1932,11 @@ fn compare_plain_link<'s>( .into()) } -fn compare_angle_link<'s>( +fn compare_angle_link<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s AngleLink<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1886,11 +1953,11 @@ fn compare_angle_link<'s>( .into()) } -fn compare_org_macro<'s>( +fn compare_org_macro<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s OrgMacro<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1907,11 +1974,11 @@ fn compare_org_macro<'s>( .into()) } -fn compare_entity<'s>( +fn compare_entity<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Entity<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1928,11 +1995,11 @@ fn compare_entity<'s>( .into()) } -fn compare_latex_fragment<'s>( +fn compare_latex_fragment<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s LatexFragment<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1949,11 +2016,11 @@ fn compare_latex_fragment<'s>( .into()) } -fn compare_export_snippet<'s>( +fn compare_export_snippet<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s ExportSnippet<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1970,11 +2037,11 @@ fn compare_export_snippet<'s>( .into()) } -fn compare_footnote_reference<'s>( +fn compare_footnote_reference<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s FootnoteReference<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -1991,11 +2058,11 @@ fn compare_footnote_reference<'s>( .into()) } -fn compare_citation<'s>( +fn compare_citation<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Citation<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2012,11 +2079,11 @@ fn compare_citation<'s>( .into()) } -fn compare_citation_reference<'s>( +fn compare_citation_reference<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s CitationReference<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2033,11 +2100,11 @@ fn compare_citation_reference<'s>( .into()) } -fn compare_inline_babel_call<'s>( +fn compare_inline_babel_call<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s InlineBabelCall<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2054,11 +2121,11 @@ fn compare_inline_babel_call<'s>( .into()) } -fn compare_inline_source_block<'s>( +fn compare_inline_source_block<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s InlineSourceBlock<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2075,11 +2142,11 @@ fn compare_inline_source_block<'s>( .into()) } -fn compare_line_break<'s>( +fn compare_line_break<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s LineBreak<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2094,11 +2161,11 @@ fn compare_line_break<'s>( .into()) } -fn compare_target<'s>( +fn compare_target<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Target<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2115,11 +2182,11 @@ fn compare_target<'s>( .into()) } -fn compare_statistics_cookie<'s>( +fn compare_statistics_cookie<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s StatisticsCookie<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2136,11 +2203,11 @@ fn compare_statistics_cookie<'s>( .into()) } -fn compare_subscript<'s>( +fn compare_subscript<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Subscript<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2157,11 +2224,11 @@ fn compare_subscript<'s>( .into()) } -fn compare_superscript<'s>( +fn compare_superscript<'b, 's>( _source: &'s str, emacs: &'s Token<'s>, rust: &'s Superscript<'s>, -) -> Result, Box> { +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None; @@ -2178,11 +2245,11 @@ fn compare_superscript<'s>( .into()) } -fn compare_timestamp<'s>( +fn compare_timestamp<'b, 's>( _source: &'s str, - emacs: &'s Token<'s>, - rust: &'s Timestamp<'s>, -) -> Result, Box> { + emacs: &'b Token<'s>, + rust: &'b Timestamp<'s>, +) -> Result, Box> { let this_status = DiffStatus::Good; let message = None;