@@ -235,9 +235,8 @@ impl EarlyLintPass for Write {
235
235
}
236
236
237
237
fn check_mac ( & mut self , cx : & EarlyContext < ' _ > , mac : & MacCall ) {
238
- fn is_build_scripts ( cx : & EarlyContext < ' _ > ) -> bool {
239
- // We could leverage the fact that Cargo sets the crate name
240
- // for build scripts to `build_script_build`.
238
+ fn is_build_script ( cx : & EarlyContext < ' _ > ) -> bool {
239
+ // Cargo sets the crate name for build scripts to `build_script_build`
241
240
cx. sess
242
241
. opts
243
242
. crate_name
@@ -246,7 +245,7 @@ impl EarlyLintPass for Write {
246
245
}
247
246
248
247
if mac. path == sym ! ( println) {
249
- if !is_build_scripts ( cx) {
248
+ if !is_build_script ( cx) {
250
249
span_lint ( cx, PRINT_STDOUT , mac. span ( ) , "use of `println!`" ) ;
251
250
}
252
251
if let ( Some ( fmt_str) , _) = self . check_tts ( cx, mac. args . inner_tokens ( ) , false ) {
@@ -263,7 +262,7 @@ impl EarlyLintPass for Write {
263
262
}
264
263
}
265
264
} else if mac. path == sym ! ( print) {
266
- if !is_build_scripts ( cx) {
265
+ if !is_build_script ( cx) {
267
266
span_lint ( cx, PRINT_STDOUT , mac. span ( ) , "use of `print!`" ) ;
268
267
}
269
268
if let ( Some ( fmt_str) , _) = self . check_tts ( cx, mac. args . inner_tokens ( ) , false ) {
0 commit comments