@@ -167,7 +167,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
167
167
let proc_res = print_source ( config,
168
168
props,
169
169
testfile,
170
- ( * srcs. get ( round) ) . to_string ( ) ,
170
+ srcs[ round] . to_string ( ) ,
171
171
"normal" ) ;
172
172
173
173
if !proc_res. status . success ( ) {
@@ -187,9 +187,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
187
187
let s = File :: open ( & filepath) . read_to_end ( ) . unwrap ( ) ;
188
188
String :: from_utf8 ( s) . unwrap ( )
189
189
}
190
- None => { ( * srcs. get ( srcs. len ( ) - 2 u) ) . clone ( ) }
190
+ None => { srcs[ srcs. len ( ) - 2 u] . clone ( ) }
191
191
} ;
192
- let mut actual = ( * srcs. get ( srcs. len ( ) - 1 u) ) . clone ( ) ;
192
+ let mut actual = srcs[ srcs. len ( ) - 1 u] . clone ( ) ;
193
193
194
194
if props. pp_exact . is_some ( ) {
195
195
// Now we have to care about line endings
@@ -209,7 +209,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
209
209
if props. no_pretty_expanded { return }
210
210
211
211
// 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" ) ;
213
213
if !proc_res. status . success ( ) {
214
214
fatal_proc_rec ( "pretty-printing (expanded) failed" , & proc_res) ;
215
215
}
@@ -702,7 +702,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
702
702
let mut rest = line. trim ( ) ;
703
703
let mut first = true ;
704
704
let mut failed = false ;
705
- for frag in check_fragments. get ( i ) . iter ( ) {
705
+ for frag in check_fragments[ i ] . iter ( ) {
706
706
let found = if first {
707
707
if rest. starts_with ( frag. as_slice ( ) ) {
708
708
Some ( 0 )
@@ -752,7 +752,7 @@ fn check_error_patterns(props: &TestProps,
752
752
}
753
753
754
754
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] ;
756
756
let mut done = false ;
757
757
let output_to_check = if props. check_stdout {
758
758
format ! ( "{}{}" , proc_res. stdout, proc_res. stderr)
@@ -761,14 +761,14 @@ fn check_error_patterns(props: &TestProps,
761
761
} ;
762
762
for line in output_to_check. as_slice ( ) . lines ( ) {
763
763
if line. contains ( next_err_pat. as_slice ( ) ) {
764
- debug ! ( "found error pattern {}" , * next_err_pat) ;
764
+ debug ! ( "found error pattern {}" , next_err_pat) ;
765
765
next_err_idx += 1 u;
766
766
if next_err_idx == props. error_patterns . len ( ) {
767
767
debug ! ( "found all error patterns" ) ;
768
768
done = true ;
769
769
break ;
770
770
}
771
- next_err_pat = props. error_patterns . get ( next_err_idx) ;
771
+ next_err_pat = & props. error_patterns [ next_err_idx] ;
772
772
}
773
773
}
774
774
if done { return ; }
@@ -847,13 +847,13 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
847
847
for line in proc_res. stderr . as_slice ( ) . lines ( ) {
848
848
let mut was_expected = false ;
849
849
for ( i, ee) in expected_errors. iter ( ) . enumerate ( ) {
850
- if !* found_flags. get ( i ) {
850
+ if !found_flags[ i ] {
851
851
debug ! ( "prefix={} ee.kind={} ee.msg={} line={}" ,
852
- prefixes. get ( i ) . as_slice( ) ,
852
+ prefixes[ i ] . as_slice( ) ,
853
853
ee. kind,
854
854
ee. msg,
855
855
line) ;
856
- if prefix_matches ( line, prefixes. get ( i ) . as_slice ( ) ) &&
856
+ if prefix_matches ( line, prefixes[ i ] . as_slice ( ) ) &&
857
857
line. contains ( ee. kind . as_slice ( ) ) &&
858
858
line. contains ( ee. msg . as_slice ( ) ) {
859
859
* found_flags. get_mut ( i) = true ;
@@ -877,7 +877,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
877
877
878
878
for ( i, & flag) in found_flags. iter ( ) . enumerate ( ) {
879
879
if !flag {
880
- let ee = expected_errors. get ( i ) ;
880
+ let ee = & expected_errors[ i ] ;
881
881
fatal_proc_rec ( format ! ( "expected {} on line {} not found: {}" ,
882
882
ee. kind, ee. line, ee. msg) . as_slice ( ) ,
883
883
proc_res) ;
0 commit comments