@@ -11,18 +11,18 @@ use annotate_snippets::display_list::DisplayList;
1111use annotate_snippets:: formatter:: DisplayListFormatter ;
1212use annotate_snippets:: snippet:: Snippet ;
1313use glob:: glob;
14- use snippet:: SnippetDef ;
14+ use crate :: snippet:: SnippetDef ;
1515use std:: error:: Error ;
1616use std:: fs:: File ;
1717use std:: io;
1818use std:: io:: prelude:: * ;
1919use std:: path:: Path ;
2020
2121fn read_file ( path : & str ) -> Result < String , io:: Error > {
22- let mut f = try! ( File :: open ( path) ) ;
22+ let mut f = File :: open ( path) ? ;
2323 let mut s = String :: new ( ) ;
24- try! ( f. read_to_string ( & mut s) ) ;
25- Ok ( s. trim_right ( ) . to_string ( ) )
24+ ( f. read_to_string ( & mut s) ) ? ;
25+ Ok ( s. trim_end ( ) . to_string ( ) )
2626}
2727
2828fn read_fixture < P : AsRef < Path > > ( path : P ) -> Result < Snippet , Box < Error > > {
@@ -49,11 +49,11 @@ fn test_fixtures() {
4949 let dlf = DisplayListFormatter :: new ( true ) ;
5050 let actual_out = dlf. format ( & dl) ;
5151 println ! ( "{}" , expected_out) ;
52- println ! ( "{}" , actual_out. trim_right ( ) ) ;
52+ println ! ( "{}" , actual_out. trim_end ( ) ) ;
5353
5454 assert_eq ! (
5555 expected_out,
56- actual_out. trim_right ( ) ,
56+ actual_out. trim_end ( ) ,
5757 "\n \n \n While parsing: {}\n The diff is:\n \n \n {}\n \n \n " ,
5858 path_in,
5959 diff:: get_diff( expected_out. as_str( ) , actual_out. as_str( ) )
0 commit comments