avsaase / cargo-new-script Goto Github PK
View Code? Open in Web Editor NEWcargo command to generate a cargo-script
cargo command to generate a cargo-script
this makes the output nicer, in my opinion:
warning: `package.edition` is unspecified, defaulting to `2021`
Compiling hello_world v0.0.0 (/SNIP/cargo-new-script)
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
Running `/SNIP/debug/hello_world`
Hello, world!
vs
Hello, world!
cargo new
always sets the edition to "current" to avoid getting the 2015 edition. With cargo scripts, the default is "current" but it warns and if something is being scaffolded it should probably include that level of "boilerplate" to remove the warning and make the script work across Rust versions
cargo-script
is obviously useful. however, developing a script is a little unpleasant since rust-analyzer doesn't currently support this single-file package form.
as an experiment (and for my own use) I've extended cargo-new-script
with a new CLI option, which works as follows
.rs
filedependencies
, it uses the dependencies obtained from the surrounding project's Cargo.toml
(then optionally runs cargo-udeps
to remove unused dependencies)if this is something you think we might be interested in, I can clean up my code and submit a PR.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.