We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 16cedb1 + eb1f78d commit 03b7dd3Copy full SHA for 03b7dd3
derive/src/pymodule.rs
@@ -169,15 +169,13 @@ where
169
while let Some((_, attr)) = iter.peek() {
170
// take all cfgs but no py items
171
let attr = *attr;
172
- let attr_name = if let Some(ident) = attr.get_ident() {
173
- ident.to_string()
174
- } else {
175
- continue;
176
- };
177
- if attr_name == "cfg" {
178
- cfgs.push(attr.clone());
179
- } else if ALL_ALLOWED_NAMES.contains(&attr_name.as_str()) {
180
- break;
+ if let Some(ident) = attr.get_ident() {
+ let attr_name = ident.to_string();
+ if attr_name == "cfg" {
+ cfgs.push(attr.clone());
+ } else if ALL_ALLOWED_NAMES.contains(&attr_name.as_str()) {
+ break;
+ }
181
}
182
iter.next();
183
0 commit comments