@@ -41,39 +41,35 @@ fn main() {
41
41
magenta. render_reset( )
42
42
) ;
43
43
44
- let message = Level :: ERROR
45
- . header ( "mismatched types" )
46
- . id ( "E0308" )
47
- . group (
48
- Group :: new ( )
49
- . element (
50
- Snippet :: source ( source)
51
- . fold ( true )
52
- . path ( "$DIR/highlighting.rs" )
53
- . annotation (
54
- AnnotationKind :: Primary
55
- . span ( 553 ..563 )
56
- . label ( "one type is more general than the other" ) ,
57
- )
58
- . annotation (
59
- AnnotationKind :: Context
60
- . span ( 547 ..552 )
61
- . label ( "arguments to this function are incorrect" ) ,
62
- ) ,
63
- )
64
- . element ( Level :: NOTE . title ( & title) ) ,
65
- )
66
- . group (
67
- Group :: new ( )
68
- . element ( Level :: NOTE . title ( "function defined here" ) )
69
- . element (
70
- Snippet :: source ( source)
71
- . fold ( true )
72
- . path ( "$DIR/highlighting.rs" )
73
- . annotation ( AnnotationKind :: Context . span ( 200 ..333 ) . label ( "" ) )
74
- . annotation ( AnnotationKind :: Primary . span ( 194 ..199 ) ) ,
75
- ) ,
76
- ) ;
44
+ let message = & [
45
+ Group :: new ( )
46
+ . element ( Level :: ERROR . title ( "mismatched types" ) . id ( "E0308" ) )
47
+ . element (
48
+ Snippet :: source ( source)
49
+ . fold ( true )
50
+ . path ( "$DIR/highlighting.rs" )
51
+ . annotation (
52
+ AnnotationKind :: Primary
53
+ . span ( 553 ..563 )
54
+ . label ( "one type is more general than the other" ) ,
55
+ )
56
+ . annotation (
57
+ AnnotationKind :: Context
58
+ . span ( 547 ..552 )
59
+ . label ( "arguments to this function are incorrect" ) ,
60
+ ) ,
61
+ )
62
+ . element ( Level :: NOTE . pre_styled_title ( & title) ) ,
63
+ Group :: new ( )
64
+ . element ( Level :: NOTE . title ( "function defined here" ) )
65
+ . element (
66
+ Snippet :: source ( source)
67
+ . fold ( true )
68
+ . path ( "$DIR/highlighting.rs" )
69
+ . annotation ( AnnotationKind :: Context . span ( 200 ..333 ) . label ( "" ) )
70
+ . annotation ( AnnotationKind :: Primary . span ( 194 ..199 ) ) ,
71
+ ) ,
72
+ ] ;
77
73
78
74
let renderer = Renderer :: styled ( ) . anonymized_line_numbers ( true ) ;
79
75
anstream:: println!( "{}" , renderer. render( message) ) ;
0 commit comments