@@ -11,18 +11,18 @@ use annotate_snippets::display_list::DisplayList;
11
11
use annotate_snippets:: formatter:: DisplayListFormatter ;
12
12
use annotate_snippets:: snippet:: Snippet ;
13
13
use glob:: glob;
14
- use snippet:: SnippetDef ;
14
+ use crate :: snippet:: SnippetDef ;
15
15
use std:: error:: Error ;
16
16
use std:: fs:: File ;
17
17
use std:: io;
18
18
use std:: io:: prelude:: * ;
19
19
use std:: path:: Path ;
20
20
21
21
fn read_file ( path : & str ) -> Result < String , io:: Error > {
22
- let mut f = try! ( File :: open ( path) ) ;
22
+ let mut f = File :: open ( path) ? ;
23
23
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 ( ) )
26
26
}
27
27
28
28
fn read_fixture < P : AsRef < Path > > ( path : P ) -> Result < Snippet , Box < Error > > {
@@ -49,11 +49,11 @@ fn test_fixtures() {
49
49
let dlf = DisplayListFormatter :: new ( true ) ;
50
50
let actual_out = dlf. format ( & dl) ;
51
51
println ! ( "{}" , expected_out) ;
52
- println ! ( "{}" , actual_out. trim_right ( ) ) ;
52
+ println ! ( "{}" , actual_out. trim_end ( ) ) ;
53
53
54
54
assert_eq ! (
55
55
expected_out,
56
- actual_out. trim_right ( ) ,
56
+ actual_out. trim_end ( ) ,
57
57
"\n \n \n While parsing: {}\n The diff is:\n \n \n {}\n \n \n " ,
58
58
path_in,
59
59
diff:: get_diff( expected_out. as_str( ) , actual_out. as_str( ) )
0 commit comments