You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lib.rs
    path of file: ./repos/ckb/util/fixed-hash/macros/src
    
    the code of the file until where you have to start completion: //! Provide several proc-macros to construct const fixed-sized hashes.
//!
//! If we use an array to construct const fixed-sized hashes, it's difficult to read.
//!
//! If we use [`FromStr::from_str`] to construct fixed-sized hashes, the result is not a constant.
//! So, it will reduce runtime performance. And it could cause a runtime error if the input is malformed.
//!
//! With proc-macros, we c
    
        pub fn $name(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
            let input = parse_macro_input!(input as syn::LitStr);
            let expanded = {
                let input = input.value().replace("_", "");
                if input.len() < 3 || &input[..2] != "0x" {
                    panic!("Input has to be a hexadecimal string with 0x-prefix.");
                };
                let input_str = &input[2..];
                let value = match &input_str[..1] {
                    "0" => {
                        if input_str.len() > 1 {
                            ckb_fixed_hash_core::$type::from_str(input_str)
                        } else {
                            ckb_fixed_hash_core::$type::from_trimmed_str(input_str)
                        }
                    },
                    _ => {
                        ckb_fixed_hash_core::$type::from_trimmed_str(input_str)
                    },
                }
                .unwrap_or_else(|err| {
                    panic!("Failed to parse the input hexadecimal string: {}", err);
                });
                let eval_str = format!("{:?}", value);
                let eval_ts: proc_macro2::TokenStream = eval_str.parse().unwrap_or_else(|_| {
                    panic!("Failed to parse the string \"{}\" to TokenStream.", eval_str);
                });
                quote!(#eval_ts)
            };
            expanded.into()
        }