Factor out buffer code

This commit is contained in:
Isaac Clayton 2022-06-07 10:10:03 +02:00
parent fbaff615a3
commit e9b87f3dc3
4 changed files with 109 additions and 118 deletions

View file

@ -61,11 +61,7 @@ pub fn bind(args: TokenStream, function: TokenStream) -> TokenStream {
// operation
let data: #ty = match ::plugin::bincode::deserialize(&data) {
Ok(d) => d,
Err(e) => {
println!("data: {:?}", data);
println!("error: {}", e);
panic!("Data passed to function not deserializable.")
},
Err(e) => panic!("Data passed to function not deserializable."),
};
let result = #inner_fn_name(#args);
let new_data: Result<Vec<u8>, _> = ::plugin::bincode::serialize(&result);