From 1234de9c22343fc4e1fe9e3e1127d2db01e96c2f Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 12 Aug 2022 17:12:03 +0200 Subject: Refactor to improve some names --- src/tokenizer.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/tokenizer.rs') diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 3f60b86..4a9fa01 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -64,12 +64,12 @@ pub struct LabelStart { pub inactive: bool, } -/// Media we found. +/// Valid label. #[derive(Debug)] -pub struct Media { - /// Indices of where the media’s label start starts and ends in `events`. +pub struct Label { + /// Indices of label start. pub start: (usize, usize), - /// Indices of where the media’s label end starts and ends in `events`. + /// Indices of label end. pub end: (usize, usize), } @@ -152,18 +152,18 @@ pub struct TokenizeState<'a> { pub space_or_tab_token: Name, // Couple of media related fields. - /// Stack of label (start) that could form images and links. + /// List of usable label starts. /// /// Used when tokenizing [text content][crate::content::text]. - pub label_start_stack: Vec, - /// Stack of label (start) that cannot form images and links. + pub label_starts: Vec, + /// List of unusable label starts. /// /// Used when tokenizing [text content][crate::content::text]. - pub label_start_list_loose: Vec, + pub label_starts_loose: Vec, /// Stack of images and links. /// /// Used when tokenizing [text content][crate::content::text]. - pub media_list: Vec, + pub labels: Vec