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: snake_name.rs
    path of file: ./repos/rbatis/rbatis-macro-driver/src/macros
    
    the code of the file until where you have to start completion: use proc_macro::TokenStream;
use quote::{quote, ToTokens};
use syn::{ItemFn, parse_macro_input, Token};
use syn::parse::{Parse, ParseStream};
use syn::punctua
    
fn to_snake_name(name: &str) -> String {
    let len = name.len();
    let bytes = name.as_bytes();
    let mut new_name = String::with_capacity(name.len());
    let mut index = 0;
    for x in bytes {
        let c = *x as char;
        if c.is_ascii_uppercase() {
            if index != 0 && (index + 1) != len {
                new_name.push('_');
            }
            new_name.push(c.to_ascii_lowercase() as char);
        } else {
            new_name.push(c);
        }
        index += 1;
    }
    return new_name;
}