feat: without root

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2023-09-26 22:37:12 +02:00
parent cd4cd35d0c
commit adee7503c5
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
2 changed files with 63 additions and 64 deletions

View File

@ -62,11 +62,9 @@ impl Node {
}
quote! {
pub mod $(&self.segment) {
$(for tokens in child_tokens join ($['\r']) => $tokens)
}
}
}
fn traverse_indent(&self, indent: usize) -> genco::lang::rust::Tokens {
tracing::trace!("node traverse visited: {}", self.segment);

View File

@ -1,5 +1,4 @@
pub mod root {
pub mod basic {
pub mod basic {
pub mod includes {
pub mod my_include {
use prost::Message;
@ -14,7 +13,8 @@ pub mod root {
where
Self: Sized,
{
let output = Self::decode(raw.as_slice()).map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
let output = Self::decode(raw.as_slice())
.map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
Ok(output)
}
}
@ -43,7 +43,8 @@ pub mod root {
where
Self: Sized,
{
let output = Self::decode(raw.as_slice()).map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
let output = Self::decode(raw.as_slice())
.map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
Ok(output)
}
}
@ -58,8 +59,8 @@ pub mod root {
}
}
}
}
pub mod examples {
}
pub mod examples {
pub mod example {
use prost::Message;
include!("examples.example.rs");
@ -73,7 +74,8 @@ pub mod root {
where
Self: Sized,
{
let output = Self::decode(raw.as_slice()).map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
let output = Self::decode(raw.as_slice())
.map_err(|e| ::crunch::errors::DeserializeError::ProtoErr(e))?;
Ok(output)
}
}
@ -88,5 +90,4 @@ pub mod root {
}
}
}
}
}