Only run the cfg check for single lines

This commit is contained in:
Yuki Okushi 2021-04-06 09:49:48 +09:00
parent 3a31a5f42c
commit 703924fad8
1 changed files with 2 additions and 3 deletions

View File

@ -125,8 +125,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
if line.len() > 80 {
err.error(path, i, "line longer than 80 chars");
}
// This doesn't work any more due to rustfmt changes
/*if line.contains("#[cfg(") && !line.contains(" if ")
if line.contains("#[cfg(") && line.contains(']') && !line.contains(" if ")
&& !(line.contains("target_endian") ||
line.contains("target_arch"))
{
@ -134,7 +133,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
err.error(path, i, "use cfg_if! and submodules \
instead of #[cfg]");
}
}*/
}
if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) {
err.error(path, i, "impl ::Copy and ::Clone manually");
}