We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to add support for input from terminal stdin like below?
cargo script <<'EOF' // cargo-deps: time use time; fn main(){ println!("I'm from stdin! {}", time::now().rfc822z()); } EOF
That way it's very straight forward to experiment in the air without any file storage.
The text was updated successfully, but these errors were encountered:
https://neosmart.net/blog/self-compiling-rust-code/
#!/bin/sh #![allow()] /* # rust self-compiler by M. Al-Qudsi, licensed as public domain or MIT. # See <https://neosmart.net/blog/self-compiling-rust-code/> for info & updates. OUT=/tmp/$(printf "%s" $(realpath $(which "$0")) | md5sum | cut -d' ' -f1) MD5=$(md5sum "$0" | cut -d' ' -f1) (test "${MD5}" = "$(cat "${OUT}.md5" 2>/dev/null)" || (grep -Eq '^\s*(\[.*?\])*\s*fn\s*main\b*' "$0" && (rm -f ${OUT}; rustc "$0" -o ${OUT} && printf "%s" ${MD5} > ${OUT}.md5) || (rm -f ${OUT}; printf "fn main() {//%s\n}" "$(cat $0)" | rustc - -o ${OUT} && printf "%s" ${MD5} > ${OUT}.md5))) && exec ${OUT} $@ || exit $? #*/ // Wrapping your code in `fn main() { … }` is altogether optional :) fn main() { let name = std::env::args().skip(1).next().unwrap_or("world".into()); println!("Hello, {}!", name); }
It's also easy to do!
Sorry, something went wrong.
No branches or pull requests
Is it possible to add support for input from terminal stdin like below?
That way it's very straight forward to experiment in the air without any file storage.
The text was updated successfully, but these errors were encountered: