jsonrpsee_core/proc_macros_support.rs
1use jsonrpsee_types::ErrorObjectOwned;
2
3// We're marking functions on the error paths as #[cold] to both reduce chance of inlining and to
4// make the generated assembly slightly better.
5
6#[cold]
7pub fn log_fail_parse(arg_pat: &str, ty: &str, err: &ErrorObjectOwned, optional: bool) {
8 let optional = if optional { "optional " } else { "" };
9 tracing::debug!("Error parsing {optional}\"{arg_pat}\" as \"{ty}\": {err}");
10}
11
12#[cfg(debug_assertions)]
13#[cold]
14pub fn panic_fail_register() -> ! {
15 panic!("RPC macro method names should never conflict. This is a bug, please report it.");
16}