rust-postgres/codegen/src/main.rs

37 lines
660 B
Rust
Raw Normal View History

2018-12-10 05:23:31 +00:00
#![warn(clippy::all)]
#![allow(clippy::write_with_newline)]
2018-12-10 05:23:31 +00:00
2018-01-10 04:32:55 +00:00
extern crate linked_hash_map;
extern crate marksman_escape;
extern crate phf_codegen;
extern crate regex;
mod sqlstate;
mod type_gen;
fn main() {
sqlstate::build();
type_gen::build();
}
fn snake_to_camel(s: &str) -> String {
let mut out = String::new();
let mut upper = true;
for ch in s.chars() {
if ch == '_' {
upper = true;
} else {
let ch = if upper {
upper = false;
ch.to_ascii_uppercase()
} else {
ch
};
out.push(ch);
}
}
out
}