Re:On Learning Rust and Go: Migrating Away from Python
by newen on Sunday March 24, 2019 @10:45AM
(#19476619)
Yeah, that is convenient and I do that often. But I try to wrap the variables in different types depending on their source (e.g. whether it's a filename or file content) so that functions further down can disambiguate between variables explicitly.
Another case is where there are two or more parameters that you want to be generic in this sense: if your only option is duplicating the function you can end up having to define inconveniently many variants.