fornwall / rust-script

Run Rust files and expressions as scripts without any setup or compilation step.
https://rust-script.org
Apache License 2.0
1.26k stars 43 forks source link

Add ability to specify template to use in the script itself #3

Closed fornwall closed 1 year ago

fornwall commented 4 years ago

It would be neat to specify which template needs to be used in the code itself (similar to how you specify dependencies). That way you don’t have to remember what flags to use every time!

Idea from https://www.reddit.com/r/rust/comments/jjnyv1/rustscript_run_rust_files_and_expressions_as/gafeock/?utm_source=reddit&utm_medium=web2x&context=3

fornwall commented 3 years ago

Note that templates currently only works for expressions. But perhaps we shouldn't introduce support for templates in scripts as they make things non-portable, and specifying a path to a local crate may be enough for users needing similar functionality?

fornwall commented 1 year ago

As said earlier, I think templates is the wrong way to go, as it complicates things and makes script non-portable. Something like #61 is probably preferable, so closing this one.