2424//! .group(
2525//! Group::new().element(
2626//! Snippet::source(source)
27- //! .origin ("temp.rs")
27+ //! .path ("temp.rs")
2828//! .line_start(1)
2929//! .fold(true)
3030//! .annotation(
@@ -232,21 +232,21 @@ impl Renderer {
232232 ) -> Result < String , fmt:: Error > {
233233 let mut out_string = String :: new ( ) ;
234234
235- let og_primary_origin = message
235+ let og_primary_path = message
236236 . groups
237237 . iter ( )
238238 . find_map ( |group| {
239239 group. elements . iter ( ) . find_map ( |s| match & s {
240240 Element :: Cause ( cause) => {
241241 if cause. markers . iter ( ) . any ( |m| m. kind . is_primary ( ) ) {
242- Some ( cause. origin )
242+ Some ( cause. path )
243243 } else {
244244 None
245245 }
246246 }
247247 Element :: Origin ( origin) => {
248248 if origin. primary {
249- Some ( Some ( origin. origin ) )
249+ Some ( Some ( origin. path ) )
250250 } else {
251251 None
252252 }
@@ -260,8 +260,8 @@ impl Renderer {
260260 . iter ( )
261261 . find_map ( |group| {
262262 group. elements . iter ( ) . find_map ( |s| match & s {
263- Element :: Cause ( cause) => Some ( cause. origin ) ,
264- Element :: Origin ( origin) => Some ( Some ( origin. origin ) ) ,
263+ Element :: Cause ( cause) => Some ( cause. path ) ,
264+ Element :: Origin ( origin) => Some ( Some ( origin. path ) ) ,
265265 _ => None ,
266266 } )
267267 } )
@@ -270,20 +270,20 @@ impl Renderer {
270270 let group_len = message. groups . len ( ) ;
271271 for ( g, group) in message. groups . into_iter ( ) . enumerate ( ) {
272272 let mut buffer = StyledBuffer :: new ( ) ;
273- let primary_origin = group
273+ let primary_path = group
274274 . elements
275275 . iter ( )
276276 . find_map ( |s| match & s {
277277 Element :: Cause ( cause) => {
278278 if cause. markers . iter ( ) . any ( |m| m. kind . is_primary ( ) ) {
279- Some ( cause. origin )
279+ Some ( cause. path )
280280 } else {
281281 None
282282 }
283283 }
284284 Element :: Origin ( origin) => {
285285 if origin. primary {
286- Some ( Some ( origin. origin ) )
286+ Some ( Some ( origin. path ) )
287287 } else {
288288 None
289289 }
@@ -295,8 +295,8 @@ impl Renderer {
295295 . elements
296296 . iter ( )
297297 . find_map ( |s| match & s {
298- Element :: Cause ( cause) => Some ( cause. origin ) ,
299- Element :: Origin ( origin) => Some ( Some ( origin. origin ) ) ,
298+ Element :: Cause ( cause) => Some ( cause. path ) ,
299+ Element :: Origin ( origin) => Some ( Some ( origin. path ) ) ,
300300 _ => None ,
301301 } )
302302 . unwrap_or_default ( ) ,
@@ -357,7 +357,7 @@ impl Renderer {
357357 & mut buffer,
358358 max_line_num_len,
359359 cause,
360- primary_origin ,
360+ primary_path ,
361361 & source_map,
362362 & annotated_lines,
363363 max_depth,
@@ -396,7 +396,7 @@ impl Renderer {
396396 suggestion,
397397 max_line_num_len,
398398 & source_map,
399- primary_origin . or ( og_primary_origin ) ,
399+ primary_path . or ( og_primary_path ) ,
400400 last_was_suggestion,
401401 ) ;
402402 last_was_suggestion = true ;
@@ -490,8 +490,8 @@ impl Renderer {
490490 labels = Some ( labels_inner) ;
491491 }
492492
493- if let Some ( origin ) = cause. origin {
494- let mut origin = Origin :: new ( origin ) ;
493+ if let Some ( path ) = cause. path {
494+ let mut origin = Origin :: new ( path ) ;
495495 origin. primary = true ;
496496
497497 let source_map = SourceMap :: new ( cause. source , cause. line_start ) ;
@@ -764,10 +764,10 @@ impl Renderer {
764764
765765 let str = match ( & origin. line , & origin. char_column ) {
766766 ( Some ( line) , Some ( col) ) => {
767- format ! ( "{}:{}:{}" , origin. origin , line, col)
767+ format ! ( "{}:{}:{}" , origin. path , line, col)
768768 }
769- ( Some ( line) , None ) => format ! ( "{}:{}" , origin. origin , line) ,
770- _ => origin. origin . to_owned ( ) ,
769+ ( Some ( line) , None ) => format ! ( "{}:{}" , origin. path , line) ,
770+ _ => origin. path . to_owned ( ) ,
771771 } ;
772772
773773 buffer. append ( buffer_msg_line_offset, & str, ElementStyle :: LineAndColumn ) ;
@@ -784,17 +784,17 @@ impl Renderer {
784784 buffer : & mut StyledBuffer ,
785785 max_line_num_len : usize ,
786786 snippet : & Snippet < ' _ , Annotation < ' _ > > ,
787- primary_origin : Option < & str > ,
787+ primary_path : Option < & str > ,
788788 sm : & SourceMap < ' _ > ,
789789 annotated_lines : & [ AnnotatedLineInfo < ' _ > ] ,
790790 multiline_depth : usize ,
791791 is_cont : bool ,
792792 ) {
793- if let Some ( origin ) = snippet. origin {
794- let mut origin = Origin :: new ( origin ) ;
793+ if let Some ( path ) = snippet. path {
794+ let mut origin = Origin :: new ( path ) ;
795795 // print out the span location and spacer before we print the annotated source
796796 // to do this, we need to know if this span will be primary
797- let is_primary = primary_origin == Some ( origin. origin ) ;
797+ let is_primary = primary_path == Some ( origin. path ) ;
798798
799799 if is_primary {
800800 origin. primary = true ;
@@ -1648,7 +1648,7 @@ impl Renderer {
16481648 suggestion : & Snippet < ' _ , Patch < ' _ > > ,
16491649 max_line_num_len : usize ,
16501650 sm : & SourceMap < ' _ > ,
1651- primary_origin : Option < & str > ,
1651+ primary_path : Option < & str > ,
16521652 is_cont : bool ,
16531653 ) {
16541654 let suggestions = sm. splice_lines ( suggestion. markers . clone ( ) ) ;
@@ -1671,14 +1671,14 @@ impl Renderer {
16711671 ElementStyle :: LineNumber ,
16721672 ) ;
16731673 }
1674- if suggestion. origin != primary_origin {
1675- if let Some ( origin ) = suggestion. origin {
1674+ if suggestion. path != primary_path {
1675+ if let Some ( path ) = suggestion. path {
16761676 let ( loc, _) = sm. span_to_locations ( parts[ 0 ] . span . clone ( ) ) ;
16771677 // --> file.rs:line:col
16781678 // |
16791679 let arrow = self . file_start ( ) ;
16801680 buffer. puts ( row_num - 1 , 0 , arrow, ElementStyle :: LineNumber ) ;
1681- let message = format ! ( "{}:{}:{}" , origin , loc. line, loc. char + 1 ) ;
1681+ let message = format ! ( "{}:{}:{}" , path , loc. line, loc. char + 1 ) ;
16821682 if is_cont {
16831683 buffer. append ( row_num - 1 , & message, ElementStyle :: LineAndColumn ) ;
16841684 } else {
0 commit comments