Starting with rust 0.29.0 the cargo install command can be used with --target. Also, install shell completion scripts for ripgrep.
Also extract out rust setup from ripgrep.