forked from rust-postgres/rust-postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rs
More file actions
36 lines (30 loc) · 655 Bytes
/
Copy pathmain.rs
File metadata and controls
36 lines (30 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
extern crate phf_codegen;
extern crate regex;
extern crate marksman_escape;
use std::ascii::AsciiExt;
use std::path::Path;
mod sqlstate;
mod types;
fn main() {
let path = Path::new("../src");
sqlstate::build(path);
types::build(path);
}
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
}