Update dependencies

This commit is contained in:
mibac138
2019-10-19 19:53:54 +02:00
parent a943a0e666
commit 9a83196e23
4 changed files with 15 additions and 17 deletions

View File

@@ -82,17 +82,15 @@ fn make_consts(codes: &LinkedHashMap<String, Vec<String>>, file: &mut BufWriter<
}
fn make_map(codes: &LinkedHashMap<String, Vec<String>>, file: &mut BufWriter<File>) {
write!(
file,
"
#[rustfmt::skip]
static SQLSTATE_MAP: phf::Map<&'static str, SqlState> = "
)
.unwrap();
let mut builder = phf_codegen::Map::new();
for (code, names) in codes {
builder.entry(&**code, &format!("SqlState::{}", &names[0]));
}
builder.build(file).unwrap();
writeln!(file, ";").unwrap();
write!(
file,
"
#[rustfmt::skip]
static SQLSTATE_MAP: phf::Map<&'static str, SqlState> = \n{};\n",
builder.build()
).unwrap();
}