File tree 1 file changed +11
-18
lines changed
1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change 41
41
// 1.57+.
42
42
43
43
use std:: env;
44
- use std:: iter;
45
44
use std:: process:: { self , Command } ;
46
45
use std:: str;
47
46
@@ -154,23 +153,17 @@ fn feature_allowed(feature: &str) -> bool {
154
153
155
154
let flags_var;
156
155
let flags_var_string;
157
- let mut flags_var_split;
158
- let mut flags_none;
159
- let flags: & mut dyn Iterator < Item = & str > =
160
- if let Some ( encoded_rustflags) = env:: var_os ( "CARGO_ENCODED_RUSTFLAGS" ) {
161
- flags_var = encoded_rustflags;
162
- flags_var_string = flags_var. to_string_lossy ( ) ;
163
- flags_var_split = flags_var_string. split ( '\x1f' ) ;
164
- & mut flags_var_split
165
- } else if let Some ( rustflags) = env:: var_os ( "RUSTFLAGS" ) {
166
- flags_var = rustflags;
167
- flags_var_string = flags_var. to_string_lossy ( ) ;
168
- flags_var_split = flags_var_string. split ( ' ' ) ;
169
- & mut flags_var_split
170
- } else {
171
- flags_none = iter:: empty ( ) ;
172
- & mut flags_none
173
- } ;
156
+ let flags = if let Some ( encoded_rustflags) = env:: var_os ( "CARGO_ENCODED_RUSTFLAGS" ) {
157
+ flags_var = encoded_rustflags;
158
+ flags_var_string = flags_var. to_string_lossy ( ) ;
159
+ flags_var_string. split ( '\x1f' )
160
+ } else if let Some ( rustflags) = env:: var_os ( "RUSTFLAGS" ) {
161
+ flags_var = rustflags;
162
+ flags_var_string = flags_var. to_string_lossy ( ) ;
163
+ flags_var_string. split ( ' ' )
164
+ } else {
165
+ return true ;
166
+ } ;
174
167
175
168
for mut flag in flags {
176
169
if flag. starts_with ( "-Z" ) {
You can’t perform that action at this time.
0 commit comments