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
Uh oh!
There was an error while loading. Please reload this page.
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::Defaulttrait 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:
All reactions