diff --git a/core/src/language/go.rs b/core/src/language/go.rs index 99811424..a5d6a6bb 100644 --- a/core/src/language/go.rs +++ b/core/src/language/go.rs @@ -200,7 +200,7 @@ impl Language for Go { .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; writeln!( w, - "const {} {} = {};", + "const {} {} = {}", c.id.renamed.to_pascal_case(), const_type, val diff --git a/core/src/parser.rs b/core/src/parser.rs index c2832f1e..53b9ed5d 100644 --- a/core/src/parser.rs +++ b/core/src/parser.rs @@ -528,7 +528,8 @@ pub(crate) fn parse_const(c: &ItemConst) -> Result { | RustType::Special(SpecialRustType::Option(_)) => { return Err(ParseError::RustConstTypeInvalid); } - RustType::Special(_s) => (), + RustType::Special(_) => (), + RustType::Simple { .. } => (), _ => return Err(ParseError::RustConstTypeInvalid), }; @@ -567,7 +568,7 @@ fn parse_const_expr(e: &Expr) -> Result { syn::visit::visit_expr(&mut expr_visitor, e); expr_visitor .0 - .map_or(Err(ParseError::RustConstTypeInvalid), |v| v) + .unwrap_or(Err(ParseError::RustConstTypeInvalid)) } // Helpers