Skip to content

Commit 679fc12

Browse files
committed
Fix unnecessary mutable at convert snippet::Slice
1 parent da93915 commit 679fc12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/display_list/from_snippet.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ fn format_annotation(annotation: snippet::Annotation<'_>) -> Vec<DisplayLine<'_>
104104
}
105105

106106
fn format_slice(
107-
mut slice: snippet::Slice<'_>,
107+
slice: snippet::Slice<'_>,
108108
is_first: bool,
109109
has_footer: bool,
110110
) -> Vec<DisplayLine<'_>> {
111111
let main_range = slice.annotations.get(0).map(|x| x.range.0);
112-
let row = slice.line_start;
113-
let origin = slice.origin.take();
112+
let origin = slice.origin;
113+
let line_start = slice.line_start;
114114
let mut body = format_body(slice, has_footer);
115-
let header = format_header(origin, main_range, row, &body, is_first);
115+
let header = format_header(origin, main_range, line_start, &body, is_first);
116116
let mut result = vec![];
117117

118118
if let Some(header) = header {

0 commit comments

Comments
 (0)