2020//! 152 | | return "test";
2121//! 153 | | }
2222//! | |___^ error: expected `String`, for `&str`.
23- //! |
2423//! ```
2524//!
2625//! The first two lines of the example above are `Raw` lines, while the rest
@@ -325,7 +324,7 @@ impl DisplaySet<'_> {
325324 }
326325
327326 let text = normalize_whitespace ( text) ;
328- let line_len = text. as_bytes ( ) . len ( ) ;
327+ let line_len = text. len ( ) ;
329328 let left = self . margin . left ( line_len) ;
330329 let right = self . margin . right ( line_len) ;
331330
@@ -1013,7 +1012,6 @@ fn format_message(
10131012 sets. push ( format_snippet (
10141013 snippet,
10151014 idx == 0 ,
1016- !footer. is_empty ( ) ,
10171015 term_width,
10181016 anonymized_line_numbers,
10191017 ) ) ;
@@ -1092,7 +1090,6 @@ fn format_label(
10921090fn format_snippet (
10931091 snippet : snippet:: Snippet < ' _ > ,
10941092 is_first : bool ,
1095- has_footer : bool ,
10961093 term_width : usize ,
10971094 anonymized_line_numbers : bool ,
10981095) -> DisplaySet < ' _ > {
@@ -1102,7 +1099,6 @@ fn format_snippet(
11021099 let mut body = format_body (
11031100 snippet,
11041101 need_empty_header,
1105- has_footer,
11061102 term_width,
11071103 anonymized_line_numbers,
11081104 ) ;
@@ -1290,7 +1286,6 @@ fn fold_body(body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
12901286fn format_body (
12911287 snippet : snippet:: Snippet < ' _ > ,
12921288 need_empty_header : bool ,
1293- has_footer : bool ,
12941289 term_width : usize ,
12951290 anonymized_line_numbers : bool ,
12961291) -> DisplaySet < ' _ > {
@@ -1605,21 +1600,6 @@ fn format_body(
16051600 ) ;
16061601 }
16071602
1608- if has_footer {
1609- body. push ( DisplayLine :: Source {
1610- lineno : None ,
1611- inline_marks : vec ! [ ] ,
1612- line : DisplaySourceLine :: Empty ,
1613- annotations : vec ! [ ] ,
1614- } ) ;
1615- } else if let Some ( DisplayLine :: Source { .. } ) = body. last ( ) {
1616- body. push ( DisplayLine :: Source {
1617- lineno : None ,
1618- inline_marks : vec ! [ ] ,
1619- line : DisplaySourceLine :: Empty ,
1620- annotations : vec ! [ ] ,
1621- } ) ;
1622- }
16231603 let max_line_num_len = if anonymized_line_numbers {
16241604 ANONYMIZED_LINE_NUM . len ( )
16251605 } else {
0 commit comments