rust-postgres/codegen/src/main.rs
Steven Fackler 4b5bcbb602 Split ToSql/FromSql out to a separate crate
Prep for a `derive` feature.
2019-10-07 17:14:18 -07:00

37 lines
660 B
Rust

#![warn(clippy::all)]
#![allow(clippy::write_with_newline)]
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
}