Skip to content

Commit 703924f

Browse files
committed
Only run the cfg check for single lines
1 parent 3a31a5f commit 703924f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ci/style.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,15 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
125125
if line.len() > 80 {
126126
err.error(path, i, "line longer than 80 chars");
127127
}
128-
// This doesn't work any more due to rustfmt changes
129-
/*if line.contains("#[cfg(") && !line.contains(" if ")
128+
if line.contains("#[cfg(") && line.contains(']') && !line.contains(" if ")
130129
&& !(line.contains("target_endian") ||
131130
line.contains("target_arch"))
132131
{
133132
if state != State::Structs {
134133
err.error(path, i, "use cfg_if! and submodules \
135134
instead of #[cfg]");
136135
}
137-
}*/
136+
}
138137
if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) {
139138
err.error(path, i, "impl ::Copy and ::Clone manually");
140139
}

0 commit comments

Comments
 (0)