mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-18 02:14:36 +00:00
allow rename with rename_all (close #2896)
This commit is contained in:
committed by
Austin Bonander
parent
16e3f1025a
commit
22e52c1171
@@ -87,14 +87,15 @@ fn expand_derive_from_row_struct(
|
||||
));
|
||||
}
|
||||
|
||||
let id_s = attributes
|
||||
.rename
|
||||
.or_else(|| Some(id.to_string().trim_start_matches("r#").to_owned()))
|
||||
.map(|s| match container_attributes.rename_all {
|
||||
let id_s = if let Some(s) = attributes.rename {
|
||||
s
|
||||
} else {
|
||||
let s = id.to_string().trim_start_matches("r#").to_owned();
|
||||
match container_attributes.rename_all {
|
||||
Some(pattern) => rename_all(&s, pattern),
|
||||
None => s,
|
||||
})
|
||||
.unwrap();
|
||||
None => s
|
||||
}
|
||||
};
|
||||
|
||||
let expr: Expr = match (attributes.flatten, attributes.try_from, attributes.json) {
|
||||
// <No attributes>
|
||||
|
||||
Reference in New Issue
Block a user