Setting PATH to a directory also unsets how to find commands.
So cargo fmt would just return command not found: cargo.
This uses a different variable other than PATH to reference the directories.
Likely this was overlooked, because it doesn't look like anyone has touched the
rust files since this hook was introduced.
Also: not everyone has a $HOME/.cargo/env, and command -v <command> is the canonical POSIX way to check if a command exists on PATH