Skip to content

Commit 6c7f2a0

Browse files
committed
Update style.rs for new Rustfmt style
1 parent 9d39310 commit 6c7f2a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ci/style.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,21 @@ 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-
if line.contains("#[cfg(") && !line.contains(" if ")
128+
// This doesn't work any more due to rustfmt changes
129+
/*if line.contains("#[cfg(") && !line.contains(" if ")
129130
&& !(line.contains("target_endian") ||
130131
line.contains("target_arch"))
131132
{
132133
if state != State::Structs {
133134
err.error(path, i, "use cfg_if! and submodules \
134135
instead of #[cfg]");
135136
}
136-
}
137+
}*/
137138
if line.contains("#[derive(") && (line.contains("Copy") || line.contains("Clone")) {
138139
err.error(path, i, "impl ::Copy and ::Clone manually");
139140
}
140141

142+
let orig_line = line;
141143
let line = line.trim_start();
142144
let is_pub = line.starts_with("pub ");
143145
let line = if is_pub {&line[4..]} else {line};
@@ -161,7 +163,7 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
161163
} else if line.starts_with("f! {") {
162164
f_macros += 1;
163165
State::FunctionDefinitions
164-
} else if line.starts_with("extern ") {
166+
} else if line.starts_with("extern ") && !orig_line.starts_with(" ") {
165167
State::Functions
166168
} else if line.starts_with("mod ") {
167169
State::Modules

0 commit comments

Comments
 (0)