fix: add public tuple field and into func

This commit is contained in:
2023-03-13 20:26:13 +01:00
committed by Kasper Juul Hermansen
parent f67928155f
commit d7317e5cf3
3 changed files with 102 additions and 12 deletions

View File

@@ -11,6 +11,12 @@ pub fn render_scalar(t: &FullType) -> eyre::Result<rust::Tokens> {
Ok(quote! {
#[derive($serialize, $deserialize, PartialEq, Debug, Clone)]
pub struct $(t.name.pipe(|n|format_name(n)))(String);
pub struct $(t.name.pipe(|n|format_name(n)))(pub String);
impl Into<$(t.name.pipe(|n| format_name(n)))> for &str {
fn into(self) -> $(t.name.pipe(|n| format_name(n))) {
$(t.name.pipe(|n| format_name(n)))(self.to_string())
}
}
})
}