File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,14 +334,14 @@ fn expand_shared(
334334 } ;
335335 let variant_ident = Ident :: new ( variant, Span :: call_site ( ) ) ;
336336
337- let source_decl = match origin_path {
337+ let source_expr = match origin_path {
338338 Some ( path) => {
339339 let path_lit = LitStr :: new ( & path. to_string_lossy ( ) , Span :: call_site ( ) ) ;
340- quote ! { const SOURCE : & str = include_str!( #path_lit) ; }
340+ quote ! { include_str!( #path_lit) }
341341 }
342342 None => {
343343 let source_lit = LitStr :: new ( & source, Span :: call_site ( ) ) ;
344- quote ! { const SOURCE : & str = #source_lit; }
344+ quote ! { #source_lit }
345345 }
346346 } ;
347347
@@ -356,8 +356,8 @@ fn expand_shared(
356356
357357 Ok ( quote ! { {
358358 #options_check
359- #source_decl
360- static SPANS : & [ #crate_path:: advanced:: HighlightSpan ] = & [ #( #span_tokens) , * ] ;
359+ const SOURCE : & str = #source_expr ;
360+ const SPANS : & [ #crate_path:: advanced:: HighlightSpan ] = & [ #( #span_tokens) , * ] ;
361361 #crate_path:: advanced:: HighlightedSource :: from_static_parts(
362362 SOURCE ,
363363 #crate_path:: Language :: #variant_ident,
You can’t perform that action at this time.
0 commit comments