Closed Liberxue closed 2 months ago
The visitor is completely unnecessary here, doesn't really simplify.
I like the idea of the
try_resugar
functions, it lets the pattern matching not be repeated twice.You could have a single
build_string
function that takes takes the encoding, tries the correct encoded pattern and tries the non-applied constructors, without repetition.Also, please leave the
if
tree since it mimics the shape of the AST and is easier for me to visualize the structure.
Done Please review~~thx @developedby
This is nicer to read without the visitor, but my other previous comments still apply.
Also, please do the changes on
resugar_list
as well. It's almost an exact copy of this one, just looking for a slightly different pattern. It would be confusing if they were implemented differently
In the resugar_lists
file, after careful reading, I found that extracting code blocks could lead to reduced performance due to cloning. I haven't thought of a better approach at the moment~~~
Can you just run cargo fmt
?
Can you just run
cargo fmt
? So Sorry OKK~~ done
Thank you very much for the contribution
713