Skip to content

Use format_ident! instead of Ident::new(&format!(...)) in model_ex (#3119) - #3122

Closed
upuddu wants to merge 1 commit into
SeaQL:masterfrom
upuddu:refactor/3119-format-ident
Closed

Use format_ident! instead of Ident::new(&format!(...)) in model_ex (#3119)#3122
upuddu wants to merge 1 commit into
SeaQL:masterfrom
upuddu:refactor/3119-format-ident

Conversation

@upuddu

@upuddu upuddu commented Jul 7, 2026

Copy link
Copy Markdown

Small step toward #3119, which asks to clean up the macros one category at a time. This handles the "manually constructed Idents" category: the two Ident::new(&format!(...), span) calls in sea-orm-macros/src/derives/model_ex.rs become format_ident!(..., span = ...), matching how idents are already built elsewhere in the crate. Purely a readability change — the generated tokens are identical.

@tyt2y3

tyt2y3 commented Aug 2, 2026

Copy link
Copy Markdown
Member

Thanks @upuddu — but master has moved past this. The {model}Ex line is already format_ident! (converted independently), and the Reverse construction this touched has since been refactored, hence the conflict. Master deliberately uses the call-site span for the generated {model}Ex ident, so re-adding model.span() isn't a change we want. One item from #3119's category does remain — the Ident::new(&format!("{forward}Reverse"), ...) at model_ex.rs:292 — worth a fresh one-liner if you'd like to keep chipping at #3119.

@tyt2y3 tyt2y3 closed this Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants