Hacker News new | ask | show | jobs
Rust goal: cargo script (like uv does for Python) (rust-lang.github.io)
1 points by IdiotSavage 4 days ago
1 comments

Already works with nightly:

https://doc.rust-lang.org/nightly/cargo/reference/unstable.h...

  #!/usr/bin/env -S cargo +nightly -Zscript
  ---cargo
  [package]
  edition = "2024"

  [profile.dev]
  opt-level = 3
  ---

  fn main() {
      println!("Hey, man!");
  }