Closed dreid closed 6 years ago
If a file matches the regex but the substitution doesn't result in a diff fastmod panics.
This makes diffs_to_print return an empty vec if there are no diffs to print and makes print_diff return a bool indicating if it printed anything.
diffs_to_print
print_diff
It looks like codemod avoids printing the filename for any empty diff so I've reorganized things slightly to calculate the diff up front and bail early if the diff is empty.
codemod
If a file matches the regex but the substitution doesn't result in a diff fastmod panics.
This makes
diffs_to_print
return an empty vec if there are no diffs to print and makesprint_diff
return a bool indicating if it printed anything.