Suppress clippy

This commit is contained in:
Kitaiti Makoto 2021-01-16 00:59:07 +09:00
parent 4a15bef34f
commit be939cf169

View File

@ -60,6 +60,7 @@ fn to_inline(tag: Tag<'_>) -> Tag<'_> {
struct HighlighterContext { struct HighlighterContext {
content: Vec<String>, content: Vec<String>,
} }
#[allow(clippy::unnecessary_wraps)]
fn highlight_code<'a>( fn highlight_code<'a>(
context: &mut Option<HighlighterContext>, context: &mut Option<HighlighterContext>,
evt: Event<'a>, evt: Event<'a>,
@ -119,6 +120,7 @@ fn highlight_code<'a>(
_ => Some(vec![evt]), _ => Some(vec![evt]),
} }
} }
#[allow(clippy::unnecessary_wraps)]
fn flatten_text<'a>(state: &mut Option<String>, evt: Event<'a>) -> Option<Vec<Event<'a>>> { fn flatten_text<'a>(state: &mut Option<String>, evt: Event<'a>) -> Option<Vec<Event<'a>>> {
let (s, res) = match evt { let (s, res) = match evt {
Event::Text(txt) => match state.take() { Event::Text(txt) => match state.take() {
@ -137,6 +139,7 @@ fn flatten_text<'a>(state: &mut Option<String>, evt: Event<'a>) -> Option<Vec<Ev
Some(res) Some(res)
} }
#[allow(clippy::unnecessary_wraps)]
fn inline_tags<'a>( fn inline_tags<'a>(
(state, inline): &mut (Vec<Tag<'a>>, bool), (state, inline): &mut (Vec<Tag<'a>>, bool),
evt: Event<'a>, evt: Event<'a>,