use diplomat_core::ast;
use std::fmt;
pub fn transform_keyword_ident(ident: &ast::Ident) -> ast::Ident {
match ident.as_str() {
"new" | "default" => ast::Ident::from(format!("{}_", ident)),
_ => ident.clone(),
}
}
pub fn gen_comment_block<W: fmt::Write>(out: &mut W, comment: &str) -> fmt::Result {
if !comment.is_empty() {
writeln!(out)?;
writeln!(out, "/**")?;
for line in comment.lines() {
writeln!(out, " * {}", line)?;
}
writeln!(out, " */")?;
}
Ok(())
}