fix(rust): apply Self usage in struct definition lint
This commit is contained in:
parent
e344837e35
commit
87d778a1c6
4 changed files with 20 additions and 20 deletions
|
|
@ -65,7 +65,7 @@ static POINT_REGEX: LazyLock<Regex> =
|
|||
pub enum TestEntry {
|
||||
Group {
|
||||
name: String,
|
||||
children: Vec<TestEntry>,
|
||||
children: Vec<Self>,
|
||||
file_path: Option<PathBuf>,
|
||||
},
|
||||
Example {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub struct Pattern {
|
|||
named: bool,
|
||||
field: Option<&'static str>,
|
||||
capture: Option<String>,
|
||||
children: Vec<Pattern>,
|
||||
children: Vec<Self>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use crate::{
|
|||
#[allow(clippy::upper_case_acronyms)]
|
||||
enum RuleJSON {
|
||||
ALIAS {
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
named: bool,
|
||||
value: String,
|
||||
},
|
||||
|
|
@ -34,46 +34,46 @@ enum RuleJSON {
|
|||
name: String,
|
||||
},
|
||||
CHOICE {
|
||||
members: Vec<RuleJSON>,
|
||||
members: Vec<Self>,
|
||||
},
|
||||
FIELD {
|
||||
name: String,
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
SEQ {
|
||||
members: Vec<RuleJSON>,
|
||||
members: Vec<Self>,
|
||||
},
|
||||
REPEAT {
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
REPEAT1 {
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
PREC_DYNAMIC {
|
||||
value: i32,
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
PREC_LEFT {
|
||||
value: PrecedenceValueJSON,
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
PREC_RIGHT {
|
||||
value: PrecedenceValueJSON,
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
PREC {
|
||||
value: PrecedenceValueJSON,
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
TOKEN {
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
IMMEDIATE_TOKEN {
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
RESERVED {
|
||||
context_name: String,
|
||||
content: Box<RuleJSON>,
|
||||
content: Box<Self>,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,15 +60,15 @@ pub enum Rule {
|
|||
Pattern(String, String),
|
||||
NamedSymbol(String),
|
||||
Symbol(Symbol),
|
||||
Choice(Vec<Rule>),
|
||||
Choice(Vec<Self>),
|
||||
Metadata {
|
||||
params: MetadataParams,
|
||||
rule: Box<Rule>,
|
||||
rule: Box<Self>,
|
||||
},
|
||||
Repeat(Box<Rule>),
|
||||
Seq(Vec<Rule>),
|
||||
Repeat(Box<Self>),
|
||||
Seq(Vec<Self>),
|
||||
Reserved {
|
||||
rule: Box<Rule>,
|
||||
rule: Box<Self>,
|
||||
context_name: String,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue