@@ -235,9 +235,8 @@ impl EarlyLintPass for Write {
235235 }
236236
237237 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`
241240 cx. sess
242241 . opts
243242 . crate_name
@@ -246,7 +245,7 @@ impl EarlyLintPass for Write {
246245 }
247246
248247 if mac. path == sym ! ( println) {
249- if !is_build_scripts ( cx) {
248+ if !is_build_script ( cx) {
250249 span_lint ( cx, PRINT_STDOUT , mac. span ( ) , "use of `println!`" ) ;
251250 }
252251 if let ( Some ( fmt_str) , _) = self . check_tts ( cx, mac. args . inner_tokens ( ) , false ) {
@@ -263,7 +262,7 @@ impl EarlyLintPass for Write {
263262 }
264263 }
265264 } else if mac. path == sym ! ( print) {
266- if !is_build_scripts ( cx) {
265+ if !is_build_script ( cx) {
267266 span_lint ( cx, PRINT_STDOUT , mac. span ( ) , "use of `print!`" ) ;
268267 }
269268 if let ( Some ( fmt_str) , _) = self . check_tts ( cx, mac. args . inner_tokens ( ) , false ) {
0 commit comments