File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -195,12 +195,13 @@ pub fn take_pyo3_options<T: Parse>(attrs: &mut Vec<Attribute>) -> Result<Vec<T>>
195
195
}
196
196
Ok ( false )
197
197
} ;
198
- if let Ok ( mut meta) = attr. parse_meta ( ) {
199
- if handle_cfg_feature_pyo3 ( & mut attr, & mut meta, parse_attr) ? {
200
- continue ;
198
+ if attr. path . is_ident ( "cfg_attr" ) {
199
+ if let Ok ( mut meta) = attr. parse_meta ( ) {
200
+ if handle_cfg_feature_pyo3 ( & mut attr, & mut meta, parse_attr) ? {
201
+ continue ;
202
+ }
201
203
}
202
204
}
203
-
204
205
if let Some ( options) = get_pyo3_options ( & attr) ? {
205
206
out. extend ( options. into_iter ( ) ) ;
206
207
continue ;
Original file line number Diff line number Diff line change @@ -70,13 +70,18 @@ impl ConstAttributes {
70
70
71
71
for mut attr in attrs. drain ( ..) {
72
72
let parse_attr = |meta, _attr : & Attribute | parse_attribute ( & mut attributes, & meta) ;
73
- if let Ok ( mut meta) = attr. parse_meta ( ) {
74
- if handle_cfg_feature_pyo3 ( & mut attr, & mut meta, parse_attr) ? {
75
- continue ;
76
- }
73
+ if attr. path . is_ident ( "cfg_attr" )
74
+ || attr. path . is_ident ( "classattr" )
75
+ || attr. path . is_ident ( "pyo3" )
76
+ {
77
+ if let Ok ( mut meta) = attr. parse_meta ( ) {
78
+ if handle_cfg_feature_pyo3 ( & mut attr, & mut meta, parse_attr) ? {
79
+ continue ;
80
+ }
77
81
78
- if parse_attribute ( & mut attributes, & meta) ? {
79
- continue ;
82
+ if parse_attribute ( & mut attributes, & meta) ? {
83
+ continue ;
84
+ }
80
85
}
81
86
}
82
87
new_attrs. push ( attr)
You can’t perform that action at this time.
0 commit comments