Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Cargo build output
/target
1 change: 1 addition & 0 deletions rust/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rust 1
23 changes: 19 additions & 4 deletions rust/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# Rust

Skeleton project for Rust.\
It is assumed that Rust is installed on your machine. If not, please follow the [installation guide](https://www.rust-lang.org/tools/install).
Skeleton project for Rust.

## Prerequisites

The toolchain this project needs is declared in [`.tool-versions`](./.tool-versions):

```
rust 1
```

Install those however you prefer, as long as they end up on your `PATH`. The quickest route is
[mise](https://mise.jdx.dev/), which reads the file for you:

```sh
mise install
```

## Usage
- `./script/setup` to fetch dependencies
- `./script/test` to run the tests
- `./script/start` to run the code
- `./script/start` to run the app

## Structure
- Code located in [`main.rs`](./src/main.rs)
- Tests located in [`lib.rs`](./src/lib.rs)

However, you're free to organise your code as you like.
However, you're free to organise your code as you like.
7 changes: 7 additions & 0 deletions rust/script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")/.."

cargo fetch
4 changes: 3 additions & 1 deletion rust/script/start
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")/.."

cargo run
4 changes: 3 additions & 1 deletion rust/script/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")/.."

cargo test
Loading