From 5bf187fab2df0122e51523d1c731e457ab366121 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 20 Jun 2022 12:34:38 +0200 Subject: Remove unneeded `pub` keywords --- src/construct/html_text.rs | 61 ++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 'src/construct/html_text.rs') diff --git a/src/construct/html_text.rs b/src/construct/html_text.rs index c118006..d50a8ce 100644 --- a/src/construct/html_text.rs +++ b/src/construct/html_text.rs @@ -75,7 +75,7 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a <|!doctype> b /// a <|!--xxx--/> b /// ``` -pub fn open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('!') => { tokenizer.consume(code); @@ -104,7 +104,7 @@ pub fn open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// a &<]]> b /// ``` -pub fn declaration_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn declaration_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('-') => { tokenizer.consume(code); @@ -133,7 +133,7 @@ pub fn declaration_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult /// ```markdown /// a b /// ``` -pub fn comment_open_inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn comment_open_inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('-') => { tokenizer.consume(code); @@ -155,7 +155,7 @@ pub fn comment_open_inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResu /// ``` /// /// [html_flow]: crate::construct::html_flow -pub fn comment_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn comment_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None | Code::Char('>') => (State::Nok, None), Code::Char('-') => { @@ -178,7 +178,7 @@ pub fn comment_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ``` /// /// [html_flow]: crate::construct::html_flow -pub fn comment_start_dash(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn comment_start_dash(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None | Code::Char('>') => (State::Nok, None), _ => comment(tokenizer, code), @@ -191,7 +191,7 @@ pub fn comment_start_dash(tokenizer: &mut Tokenizer, code: Code) -> StateFnResul /// a b /// a b /// ``` -pub fn comment(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn comment(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None => (State::Nok, None), Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { @@ -214,7 +214,7 @@ pub fn comment(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// ``` -pub fn comment_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn comment_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('-') => { tokenizer.consume(code); @@ -233,7 +233,7 @@ pub fn comment_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a &<]]> b /// a &<]]> b /// ``` -pub fn cdata_open_inside( +fn cdata_open_inside( tokenizer: &mut Tokenizer, code: Code, buffer: Vec, @@ -263,7 +263,7 @@ pub fn cdata_open_inside( /// ```markdown /// a &<]]> b /// ``` -pub fn cdata(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn cdata(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None => (State::Nok, None), Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { @@ -285,7 +285,7 @@ pub fn cdata(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ```markdown /// a &<]|]> b /// ``` -pub fn cdata_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn cdata_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char(']') => { tokenizer.consume(code); @@ -300,7 +300,7 @@ pub fn cdata_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ```markdown /// a &<]]|> b /// ``` -pub fn cdata_end(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn cdata_end(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('>') => end(tokenizer, code), Code::Char(']') => cdata_close(tokenizer, code), @@ -313,7 +313,7 @@ pub fn cdata_end(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ```markdown /// a b /// ``` -pub fn declaration(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn declaration(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None | Code::Char('>') => end(tokenizer, code), Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { @@ -332,7 +332,7 @@ pub fn declaration(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// a b /// ``` -pub fn instruction(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn instruction(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None => (State::Nok, None), Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { @@ -355,7 +355,7 @@ pub fn instruction(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// a b /// ``` -pub fn instruction_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn instruction_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char('>') => end(tokenizer, code), _ => instruction(tokenizer, code), @@ -367,7 +367,7 @@ pub fn instruction_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult /// ```markdown /// a b /// ``` -pub fn tag_close_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_close_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char(char) if char.is_ascii_alphabetic() => { tokenizer.consume(code); @@ -383,7 +383,7 @@ pub fn tag_close_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// a b /// ``` -pub fn tag_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char(char) if char == '-' || char.is_ascii_alphanumeric() => { tokenizer.consume(code); @@ -399,7 +399,7 @@ pub fn tag_close(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// a b /// ``` -pub fn tag_close_between(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_close_between(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { at_line_ending(tokenizer, code, Box::new(tag_close_between)) @@ -417,7 +417,7 @@ pub fn tag_close_between(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult /// ```markdown /// a b /// ``` -pub fn tag_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char(char) if char == '-' || char.is_ascii_alphanumeric() => { tokenizer.consume(code); @@ -437,7 +437,7 @@ pub fn tag_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// a b /// a b /// ``` -pub fn tag_open_between(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_open_between(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { at_line_ending(tokenizer, code, Box::new(tag_open_between)) @@ -465,7 +465,7 @@ pub fn tag_open_between(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult /// a b /// a b /// ``` -pub fn tag_open_attribute_name(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_open_attribute_name(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::Char(char) if char == '-' @@ -489,7 +489,7 @@ pub fn tag_open_attribute_name(tokenizer: &mut Tokenizer, code: Code) -> StateFn /// a b /// a b /// ``` -pub fn tag_open_attribute_name_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_open_attribute_name_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { at_line_ending(tokenizer, code, Box::new(tag_open_attribute_name_after)) @@ -513,7 +513,7 @@ pub fn tag_open_attribute_name_after(tokenizer: &mut Tokenizer, code: Code) -> S /// a b /// a b /// ``` -pub fn tag_open_attribute_value_before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_open_attribute_value_before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None | Code::Char('<' | '=' | '>' | '`') => (State::Nok, None), Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { @@ -545,7 +545,7 @@ pub fn tag_open_attribute_value_before(tokenizer: &mut Tokenizer, code: Code) -> /// a b /// a b /// ``` -pub fn tag_open_attribute_value_quoted( +fn tag_open_attribute_value_quoted( tokenizer: &mut Tokenizer, code: Code, marker: char, @@ -583,7 +583,7 @@ pub fn tag_open_attribute_value_quoted( /// ```markdown /// a b /// ``` -pub fn tag_open_attribute_value_unquoted(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn tag_open_attribute_value_unquoted(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None | Code::Char('"' | '\'' | '<' | '=' | '`') => (State::Nok, None), Code::CarriageReturnLineFeed @@ -602,10 +602,7 @@ pub fn tag_open_attribute_value_unquoted(tokenizer: &mut Tokenizer, code: Code) /// ```markdown /// a b /// ``` -pub fn tag_open_attribute_value_quoted_after( - tokenizer: &mut Tokenizer, - code: Code, -) -> StateFnResult { +fn tag_open_attribute_value_quoted_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::CarriageReturnLineFeed | Code::VirtualSpace @@ -621,7 +618,7 @@ pub fn tag_open_attribute_value_quoted_after( /// a b /// ``` -pub fn at_line_ending( +fn at_line_ending( tokenizer: &mut Tokenizer, code: Code, return_state: Box, @@ -671,7 +668,7 @@ pub fn at_line_ending( /// a b /// ``` -pub fn after_line_ending( +fn after_line_ending( tokenizer: &mut Tokenizer, code: Code, return_state: Box, @@ -691,7 +688,7 @@ pub fn after_line_ending( /// a b /// ``` -pub fn after_line_ending_prefix( +fn after_line_ending_prefix( tokenizer: &mut Tokenizer, code: Code, return_state: Box, -- cgit