Implement std::default::Default
#1369
nicksrandall
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I maintain a library which uses "sqlparser-rs" to generate sql queries (so I'm programatically generating ASTs) and one pain-point for me is how often the ASTs are getting breaking changes.
One idea I had on how the pain could be mitigated is if each AST struct implemented the
std::default::Default
trait so that generating ASTs programatically would be much simpler because I'd just need to focus on the fields that are important to the dialect that I'm using and let..Default::default()
handle everything else.It wouldn't fix everything but it would make working the the ast nicer (IMHO).
Here is an example:
would become:
Beta Was this translation helpful? Give feedback.
All reactions