@@ -167,7 +167,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
167167 let proc_res = print_source ( config,
168168 props,
169169 testfile,
170- ( * srcs. get ( round) ) . to_string ( ) ,
170+ srcs[ round] . to_string ( ) ,
171171 "normal" ) ;
172172
173173 if !proc_res. status . success ( ) {
@@ -187,9 +187,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
187187 let s = File :: open ( & filepath) . read_to_end ( ) . unwrap ( ) ;
188188 String :: from_utf8 ( s) . unwrap ( )
189189 }
190- None => { ( * srcs. get ( srcs. len ( ) - 2 u) ) . clone ( ) }
190+ None => { srcs[ srcs. len ( ) - 2 u] . clone ( ) }
191191 } ;
192- let mut actual = ( * srcs. get ( srcs. len ( ) - 1 u) ) . clone ( ) ;
192+ let mut actual = srcs[ srcs. len ( ) - 1 u] . clone ( ) ;
193193
194194 if props. pp_exact . is_some ( ) {
195195 // Now we have to care about line endings
@@ -209,7 +209,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
209209 if props. no_pretty_expanded { return }
210210
211211 // additionally, run `--pretty expanded` and try to build it.
212- let proc_res = print_source ( config, props, testfile, ( * srcs. get ( round) ) . clone ( ) , "expanded" ) ;
212+ let proc_res = print_source ( config, props, testfile, srcs[ round] . clone ( ) , "expanded" ) ;
213213 if !proc_res. status . success ( ) {
214214 fatal_proc_rec ( "pretty-printing (expanded) failed" , & proc_res) ;
215215 }
@@ -702,7 +702,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
702702 let mut rest = line. trim ( ) ;
703703 let mut first = true ;
704704 let mut failed = false ;
705- for frag in check_fragments. get ( i ) . iter ( ) {
705+ for frag in check_fragments[ i ] . iter ( ) {
706706 let found = if first {
707707 if rest. starts_with ( frag. as_slice ( ) ) {
708708 Some ( 0 )
@@ -752,7 +752,7 @@ fn check_error_patterns(props: &TestProps,
752752 }
753753
754754 let mut next_err_idx = 0 u;
755- let mut next_err_pat = props. error_patterns . get ( next_err_idx) ;
755+ let mut next_err_pat = & props. error_patterns [ next_err_idx] ;
756756 let mut done = false ;
757757 let output_to_check = if props. check_stdout {
758758 format ! ( "{}{}" , proc_res. stdout, proc_res. stderr)
@@ -761,14 +761,14 @@ fn check_error_patterns(props: &TestProps,
761761 } ;
762762 for line in output_to_check. as_slice ( ) . lines ( ) {
763763 if line. contains ( next_err_pat. as_slice ( ) ) {
764- debug ! ( "found error pattern {}" , * next_err_pat) ;
764+ debug ! ( "found error pattern {}" , next_err_pat) ;
765765 next_err_idx += 1 u;
766766 if next_err_idx == props. error_patterns . len ( ) {
767767 debug ! ( "found all error patterns" ) ;
768768 done = true ;
769769 break ;
770770 }
771- next_err_pat = props. error_patterns . get ( next_err_idx) ;
771+ next_err_pat = & props. error_patterns [ next_err_idx] ;
772772 }
773773 }
774774 if done { return ; }
@@ -847,13 +847,13 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
847847 for line in proc_res. stderr . as_slice ( ) . lines ( ) {
848848 let mut was_expected = false ;
849849 for ( i, ee) in expected_errors. iter ( ) . enumerate ( ) {
850- if !* found_flags. get ( i ) {
850+ if !found_flags[ i ] {
851851 debug ! ( "prefix={} ee.kind={} ee.msg={} line={}" ,
852- prefixes. get ( i ) . as_slice( ) ,
852+ prefixes[ i ] . as_slice( ) ,
853853 ee. kind,
854854 ee. msg,
855855 line) ;
856- if prefix_matches ( line, prefixes. get ( i ) . as_slice ( ) ) &&
856+ if prefix_matches ( line, prefixes[ i ] . as_slice ( ) ) &&
857857 line. contains ( ee. kind . as_slice ( ) ) &&
858858 line. contains ( ee. msg . as_slice ( ) ) {
859859 * found_flags. get_mut ( i) = true ;
@@ -877,7 +877,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
877877
878878 for ( i, & flag) in found_flags. iter ( ) . enumerate ( ) {
879879 if !flag {
880- let ee = expected_errors. get ( i ) ;
880+ let ee = & expected_errors[ i ] ;
881881 fatal_proc_rec ( format ! ( "expected {} on line {} not found: {}" ,
882882 ee. kind, ee. line, ee. msg) . as_slice ( ) ,
883883 proc_res) ;
0 commit comments