autocommit 2022-03-30 03:00:46 CEST
This commit is contained in:
parent
9842264fad
commit
28c9b46400
40 changed files with 1212 additions and 175 deletions
|
|
@ -8,7 +8,7 @@
|
|||
clippy::unnecessary_to_owned,
|
||||
clippy::match_like_matches_macro,
|
||||
clippy::too_many_arguments,
|
||||
clippy::iter_skip_next,
|
||||
clippy::iter_skip_next
|
||||
)]
|
||||
|
||||
extern crate core;
|
||||
|
|
|
|||
|
|
@ -590,6 +590,7 @@ fn write_message<W: Write>(f: &mut W, obj: &BStr, message: &Message) -> Result<(
|
|||
writeln!(f, " pub const {}: u32 = {};", uppercase, message.id.val)?;
|
||||
write_message_type(f, obj, message, has_reference_type)?;
|
||||
let lifetime = if has_reference_type { "<'a>" } else { "" };
|
||||
let lifetime_b = if has_reference_type { "<'b>" } else { "" };
|
||||
let parser = if message.fields.len() > 0 {
|
||||
"parser"
|
||||
} else {
|
||||
|
|
@ -600,6 +601,12 @@ fn write_message<W: Write>(f: &mut W, obj: &BStr, message: &Message) -> Result<(
|
|||
" impl<'a> RequestParser<'a> for {}{} {{",
|
||||
message.camel_name, lifetime
|
||||
)?;
|
||||
writeln!(
|
||||
f,
|
||||
" type Generic<'b> = {}{};",
|
||||
message.camel_name, lifetime_b,
|
||||
)?;
|
||||
writeln!(f, " const ID: u32 = {};", message.id.val,)?;
|
||||
writeln!(
|
||||
f,
|
||||
" fn parse({}: &mut MsgParser<'_, 'a>) -> Result<Self, MsgParserError> {{",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue