style(treewide): Format

This commit is contained in:
Benedikt Peetz 2024-03-27 22:20:19 +01:00
parent 7f6c76a6a6
commit a766149521
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
3 changed files with 7 additions and 10 deletions

View File

@ -31,11 +31,7 @@ use crate::{
impl Function { impl Function {
pub fn to_c(&self, config: &TrixyConfig, namespaces: &Vec<&Identifier>) -> TokenStream2 { pub fn to_c(&self, config: &TrixyConfig, namespaces: &Vec<&Identifier>) -> TokenStream2 {
let ident = self.identifier.to_c_with_path(namespaces); let ident = self.identifier.to_c_with_path(namespaces);
let inputs: Vec<TokenStream2> = self let inputs: Vec<TokenStream2> = self.inputs.iter().map(NamedType::to_c).collect();
.inputs
.iter()
.map(NamedType::to_c)
.collect();
let callback_function = format_ident!("{}", config.callback_function); let callback_function = format_ident!("{}", config.callback_function);

View File

@ -34,9 +34,11 @@ pub mod rust;
pub fn format_rust(input: TokenStream2) -> String { pub fn format_rust(input: TokenStream2) -> String {
prettyplease::unparse( prettyplease::unparse(
&syn::parse2(input.clone()).map_err(|err| { &syn::parse2(input.clone())
.map_err(|err| {
eprintln!("{}:\n===\n{}\n===\n", err, input); eprintln!("{}:\n===\n{}\n===\n", err, input);
}).expect("This code was generated, it should also be parsable"), })
.expect("This code was generated, it should also be parsable"),
) )
} }

View File

@ -21,8 +21,7 @@
cargo update && cargo upgrade cargo update && cargo upgrade
cd ./example/main || { cd ./example/main || {
echo "Main example is missing"; echo "Main example is missing"
exit 1 exit 1
} }
cargo update && cargo upgrade cargo update && cargo upgrade