Update to protocol 0.2

This commit is contained in:
Steven Fackler
2016-12-18 16:11:38 -08:00
parent 8e5f28eb70
commit 9d53e677ff
9 changed files with 231 additions and 158 deletions

View File

@@ -120,10 +120,10 @@ fn make_impl(codes: &[Code], file: &mut BufWriter<File>) {
write!(file, r#"
impl SqlState {{
/// Creates a `SqlState` from its error code.
pub fn from_code(s: String) -> SqlState {{
match SQLSTATE_MAP.get(&*s) {{
pub fn from_code(s: &str) -> SqlState {{
match SQLSTATE_MAP.get(s) {{
Some(state) => state.clone(),
None => SqlState::Other(s),
None => SqlState::Other(s.to_owned()),
}}
}}