difftreelog
style fix clippy warnings
in: master
1 file changed
crates/jrsonnet-peg-parser/src/lib.rsdiffbeforeafterboth29}29}303031parser! {31parser! {32 grammar jsonnet_parser() for str {32 pub grammar jsonnet_parser() for str {33 use peg::ParseLiteral;33 use peg::ParseLiteral;343435 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() }606061 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()636364 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) -> ExprParams92 }92 }939394 pub rule destruct_rest() -> DestructRest94 pub rule destruct_rest() -> DestructRest95 = "..." 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) -> Destruct99 = "[" _ start:destruct(s)**comma() rest:(97 = "[" _ start:destruct(s)**comma() rest:(100 comma() _ rest:destruct_rest()? end:(98 comma() _ rest:destruct_rest()? end:(