mirror of
https://github.com/openharmony/third_party_rust_libc.git
synced 2026-07-21 02:15:44 -04:00
style: Enforce order of any s_*! macro call
Before this change, only the order of `s!` was checked. After, it also checks `s_no_extra_traits!` and `s_paren!`. Only the order is checked, not the number of calls. This is required because multiple calls have to be allowed.
This commit is contained in:
@@ -142,6 +142,12 @@ fn check_style(file: &str, path: &Path, err: &mut Errors) {
|
||||
} else if line.starts_with("s! {") {
|
||||
s_macros += 1;
|
||||
State::Structs
|
||||
} else if line.starts_with("s_no_extra_traits! {") {
|
||||
// multiple macros of this type are allowed
|
||||
State::Structs
|
||||
} else if line.starts_with("s_paren! {") {
|
||||
// multiple macros of this type are allowed
|
||||
State::Structs
|
||||
} else if line.starts_with("f! {") {
|
||||
f_macros += 1;
|
||||
State::FunctionDefinitions
|
||||
|
||||
Reference in New Issue
Block a user