(res: Result<T>)
| 39 | } |
| 40 | |
| 41 | pub fn result_to_cstring<T: ToString>(res: Result<T>) -> CString { |
| 42 | let inner = match res { |
| 43 | Ok(inn) => format!("{{ \"ok\": {} }}", inn.to_string()), |
| 44 | Err(err) => format!("{{ \"err\": \"{}\" }}", err.to_string()), |
| 45 | }; |
| 46 | |
| 47 | CString::new(inner).unwrap() |
| 48 | } |
| 49 | |
| 50 | macro_rules! export_fn { |
| 51 | ($fn_name:ident,String)=> { |
nothing calls this directly
no outgoing calls
no test coverage detected