This experimental RFC adds unstable support for single-file packages in cargo. (rfc 3424)
Putting some examples of cargo scripts
to test the ability to have a single file script.
You can find example here
./bin/install_trunk.rs
I was using a rust project to create a static site using leptos, but needed a way to globally install a cargo crate (trunk) prior to using the command in creating a build. I've included the install script here with others.