rust-script icon indicating copy to clipboard operation
rust-script copied to clipboard

[Improvement] Better error message when cargo is unavailable

Open vic1707 opened this issue 1 month ago • 0 comments

It sounds really obvious and dumb but I wanted to check if rust-script requires you to have installed cargo (rust-script doesn't bundle it), which it unsurprisingly does. I may have missed it, but this isn't written in the docs.

  zsh ❯ cargo                 
zsh: command not found: cargo

  zsh ❯ rustc             
zsh: command not found: rustc

  zsh ❯ rust-script hash     
error: No such file or directory (os error 2) # which file?

But when I make cargo available via dotfiles' . "~/.cargo/env" it works like a charm.

Would be nice to write it in the docs or at least provide a better error message.

vic1707 avatar Nov 21 '25 13:11 vic1707