working towards being compatible with the latest proc-macro2.  related to
@@ -746,8 +746,7 @@ fn translate_type(filename: &DirEntry, ty: &Type) -> Option<(String, bool, Optio
fn deconstruct_macro(as_string: &str) -> Option<(String, Option<String>, bool)> {
if as_string.starts_with("default !") {
- let regexp =
- regex::Regex::new(r#"default ! \( (?P<type>.*?)\s*, (?P<value>.*) \)"#).unwrap();
+ let regexp = regex::Regex::new(r#"default ! \((?P<type>.*?)\s*, (?P<value>.*)\)"#).unwrap();
let default_value =
Some(get_named_capture(&regexp, "value", as_string).expect("no default value"));
@@ -798,7 +797,7 @@ fn translate_type_string(
"& str" | "& 'static str" | "&'static str" | "String" | "& 'static String" | "& String" => {
Some(("text".to_string(), false, default_value, variadic))
}
- "& [ u8 ]" | "& 'static [ u8 ]" | "&'static [ u8 ]" | "Vec < u8 >" => {
+ "& [u8]" | "&[u8]" | "& 'static [u8]" | "&'static [u8]" | "Vec < u8 >" => {
Some(("bytea".to_string(), false, default_value, variadic))
}
"& std :: ffi :: CStr" => Some(("cstring".to_string(), false, default_value, variadic)),
@@ -1093,7 +1092,6 @@ fn collect_attributes(
let a = attrs.get(i).unwrap();
let span = a.span();
let as_string = a.to_token_stream().to_string();
-
if as_string == "# [pg_guard]" {
categorized_attributes.push(CategorizedAttribute::PgGuard(span));
} else if as_string.starts_with("# [pg_extern") {
