> For the complete documentation index, see [llms.txt](https://davidsietz.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidsietz.gitbook.io/workspace/module-02/02-section-03.md).

# Section III - Creating an Executable

Although this package was created as a library, we can make it dual binary and library by doing the following:

1. Modifiy the Cargo.toml file to point to a binary during build time

```
[[bin]]
name = "hello_world"
path = "src/bin/hello-world.rs"
```

1. Create a new **bin** folder in the **src** directory
2. Create a new file **hello-world.rs** in the **bin** directory with the following code

```
pub fn main() {
    println!("Hello World");
}
```

1. Build and run the package&#x20;

```
[user@localhost rust-daas]$ cargo run
   Compiling rust-daas v0.1.0 (C:\workspace\rust-daas)
    Finished dev [unoptimized + debuginfo] target(s) in 0.67s
     Running `target\debug\hello_world.exe`
Hello World
```

> There should now be an executable named **hello\_world** in the /target/debug directory which you can execute directly.

```
[user@localhost rust-daas]$  cd .\target\debug\
[user@localhost debug]$ ./hello_world
Hello World
```
