git.delta.rocks / jrsonnet / refs/commits / f1b79348e232

difftreelog

style fix clippy warnings

ylxknpqrYaroslav Bolyukin2026-04-25parent: #7af406e.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-peg-parser/src/lib.rsdiffbeforeafterboth
29}29}
3030
31parser! {31parser! {
32 grammar jsonnet_parser() for str {32 pub grammar jsonnet_parser() for str {
33 use peg::ParseLiteral;33 use peg::ParseLiteral;
3434
35 rule eof() = quiet!{![_]} / expected!("<eof>")35 rule eof() = quiet!{![_]} / expected!("<eof>")
59 rule id() -> IStr = v:$(quiet!{ !reserved() alpha() (alpha() / digit())*} / expected!("<identifier>")) { v.into() }59 rule id() -> IStr = v:$(quiet!{ !reserved() alpha() (alpha() / digit())*} / expected!("<identifier>")) { v.into() }
6060
61 rule keyword(id: &'static str) -> ()61 rule keyword(id: &'static str) -> ()
62 = #parse_string_literal(id) end_of_ident()62 = #{|input, pos| input.parse_string_literal(pos, id)} end_of_ident()
6363
64 pub rule param(s: &ParserSettings) -> ExprParam = destruct:destruct(s) expr:(_ "=" _ expr:expr(s){expr})? { ExprParam { destruct, default: expr.map(Rc::new) } }64 pub rule param(s: &ParserSettings) -> ExprParam = destruct:destruct(s) expr:(_ "=" _ expr:expr(s){expr})? { ExprParam { destruct, default: expr.map(Rc::new) } }
65 pub rule params(s: &ParserSettings) -> ExprParams65 pub rule params(s: &ParserSettings) -> ExprParams
92 }92 }
9393
94 pub rule destruct_rest() -> DestructRest94 pub rule destruct_rest() -> DestructRest
95 = "..." into:(_ into:id() {into})? {if let Some(into) = into {95 = "..." into:(_ into:id() {into})? {into.map_or_else(|| DestructRest::Drop, DestructRest::Keep)}
96 DestructRest::Keep(into)
97 } else {DestructRest::Drop}}
98 pub rule destruct_array(s: &ParserSettings) -> Destruct96 pub rule destruct_array(s: &ParserSettings) -> Destruct
99 = "[" _ start:destruct(s)**comma() rest:(97 = "[" _ start:destruct(s)**comma() rest:(
100 comma() _ rest:destruct_rest()? end:(98 comma() _ rest:destruct_rest()? end:(