@@ -91,10 +91,14 @@ impl Do {
91
91
pub fn to_tokens ( & self , mut read_response : bool , tokens : & mut Tokens ) -> bool {
92
92
self . api_call . to_tokens ( tokens) ;
93
93
94
- // only assert that there are no warnings if expected warnings is empty and not allowing warnings
94
+ // Filter out [types removal] warnings in all cases, same as the java runner. This should
95
+ // really be in the yaml tests themselves
95
96
if !self . warnings . is_empty ( ) {
96
97
tokens. append ( quote ! {
97
- let warnings: Vec <& str > = response. warning_headers( ) . collect( ) ;
98
+ let warnings: Vec <& str > = response
99
+ . warning_headers( )
100
+ . filter( |w| !w. starts_with( "[types removal]" ) )
101
+ . collect( ) ;
98
102
} ) ;
99
103
for warning in & self . warnings {
100
104
tokens. append ( quote ! {
@@ -106,7 +110,7 @@ impl Do {
106
110
tokens. append ( quote ! {
107
111
let allowed_warnings = vec![ #( #allowed) , * ] ;
108
112
let warnings: Vec <& str > = response. warning_headers( )
109
- . filter( |w| !allowed_warnings. iter( ) . any( |a| w. contains( a) ) )
113
+ . filter( |w| !w . starts_with ( "[types removal]" ) || ! allowed_warnings. iter( ) . any( |a| w. contains( a) ) )
110
114
. collect( ) ;
111
115
assert_warnings_is_empty!( warnings) ;
112
116
} ) ;
@@ -122,11 +126,10 @@ impl Do {
122
126
c. to_tokens ( tokens) ;
123
127
}
124
128
125
- match & self . api_call . ignore {
126
- Some ( i ) => tokens. append ( quote ! {
129
+ if let Some ( i ) = & self . api_call . ignore {
130
+ tokens. append ( quote ! {
127
131
assert_response_success_or!( response, #i) ;
128
- } ) ,
129
- None => ( ) ,
132
+ } ) ;
130
133
}
131
134
132
135
read_response
0 commit comments