3 ms·
That's the hard way. `cargo new` generates both for you, so you don't need to do any of that stuff manually. If you really, really want to, you could use https
by steveklabnik 8y ago
That's the hard way. `cargo new` generates both for you, so you don't need to do any of that stuff manually.
If you really, really want to, you could use https://crates.io/crates/cargo-script https://crates.io/crates/cargo-script to do the way you're talking about.
https://doc.rust-lang.org/cargo/ https://doc.rust-lang.org/cargo/ has installation, getting started, a reference, all of that. It needs some work, but for the basics of doing this, it's got it all.