You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fact that you have to make this change in two places is a bit of a code smell. It should be possible to do something like let generator = match language { /*...*/ }; outside of the match args.get_one::<String>("schema").
If we're going to be unconditionally printing some warnings, perhaps we can print to std err instead of std out, and then we also don't need to worry about coloring them, since the colors often show up as gibberish in text log files.
Rather than having multiple println!() in the print warnings functions, why not combine it into one multiline string?
Should the generator trait have a print_implementation_notes() function? Then you can get the language specific generator and call the function on that instead of having to include it in the language matching branches.
To accomplish this, it might be helpful to have an AnyLanguage enum that can delegate to the correct language (similar to the AnyEncoding enum in ion-rust).
I think all of this can be addressed in a separate PR, though.
As per the suggestions in this thread:
let generator = match language { /*...*/ };
outside of thematch args.get_one::<String>("schema")
.println!()
in the print warnings functions, why not combine it into one multiline string?print_implementation_notes()
function? Then you can get the language specific generator and call the function on that instead of having to include it in the language matching branches.AnyLanguage
enum that can delegate to the correct language (similar to theAnyEncoding
enum inion-rust
).I think all of this can be addressed in a separate PR, though.
Originally posted by @popematt in #148 (comment)
The text was updated successfully, but these errors were encountered: