This should be more reliable. Current assumption that rustup always install cargo inside ~/.cargo is wrong when rustup is installed through linux package manager.
We can't however just invoke any cargo that we find, because that might be system cargo intallation (i.e. homebrew) that has no access to rustup toolchains.
I think the referred way for this would be to always invoked cargo through rustup run stable cargo ... and prepend ~/cargo/bin to PATH when doing it.
This should be more reliable. Current assumption that rustup always install cargo inside
~/.cargo
is wrong when rustup is installed through linux package manager.We can't however just invoke any cargo that we find, because that might be system cargo intallation (i.e. homebrew) that has no access to rustup toolchains.
I think the referred way for this would be to always invoked cargo through
rustup run stable cargo ...
and prepend ~/cargo/bin toPATH
when doing it.