rustbasic-core 0.0.2

Core framework logic for RustBasic - A modern web framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
pub fn to_snake_case(s: &str) -> String {
    let mut snake = String::new();
    for (i, ch) in s.chars().enumerate() {
        if ch.is_uppercase() && i != 0 {
            snake.push('_');
        }
        snake.push(ch.to_ascii_lowercase());
    }
    snake
}