From 88d1c902f7a1677516a2eabadf792e870e233bc2 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 14 Oct 2022 13:37:22 +0200 Subject: Remove `must_use` if tarpaulin doesn’t understand them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also moves some code to separate files, in the hopes that tarpaulin understands them. --- src/to_html.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/to_html.rs') diff --git a/src/to_html.rs b/src/to_html.rs index 6811350..2685120 100644 --- a/src/to_html.rs +++ b/src/to_html.rs @@ -216,9 +216,8 @@ pub fn compile(events: &[Event], bytes: &[u8], options: &CompileOptions) -> Stri if event.kind == Kind::Exit && (event.name == Name::BlankLineEnding || event.name == Name::LineEnding) { - line_ending_inferred = Some(LineEnding::from_str( - Slice::from_position(bytes, &Position::from_exit_event(events, index)).as_str(), - )); + let slice = Slice::from_position(bytes, &Position::from_exit_event(events, index)); + line_ending_inferred = Some(slice.as_str().parse().unwrap()); break; } -- cgit