---
# System prepended metadata

title: '`cargo-script` implementaion'

---

# `cargo-script` implementaion

### Links
[RFC](https://github.com/rust-lang/rfcs/pull/3424)
[Rendered](https://github.com/epage/rfcs/blob/cargo-script/text/3424-cargo-script.md)

### Decisions
* Module level doc comment
  * `//!` and `/*!`
* Precedence
    * `cmd.ends_with(".rs") || 1 < Path::new(cmd).components().count()`
    * built-in, alias, external
    * `Path::new(cmd).exists()`
* Package names
    * `package.name = <slugified file stem>`
    * if there is no `package.name` create a valid package name from the file stem

Testing note:
- Alias precedence code exists "just in case" because we don't properly handle it when we look up an alias key with `.`

### `todo!()`
- Tests for supported keys
- Tests for unsupported keys
    - `workspace`
    - `lib`
    - `bin`
    - `example`
    - `test`
    - `bench`
    - `package.workspace`
    - `package.build`
    - `package.links`
    - `package.autobins`
    - `package.autoexamples`
    - `package.autotests`
    - `package.autobenches`
- How should package names look?