Rust template

This commit is contained in:
Tobias Berger 2022-12-01 10:32:29 +01:00
parent 13a623f55b
commit 14abcd622e
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
7 changed files with 54 additions and 0 deletions

1
rust/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

7
rust/Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "advent-of-code"
version = "22.0.2"

28
rust/Cargo.toml Normal file
View file

@ -0,0 +1,28 @@
[package]
name = "advent-of-code"
version = "22.0.2"
edition = "2021"
resolver = "2"
[profile.release]
strip = "symbols"
lto = "fat"
opt-level = 3
codegen-units = 1
[profile.dev.package."*"]
opt-level = 3
codegen-units = 1
[profile.release.package."*"]
opt-level = 3
codegen-units = 1
[profile.dev.build-override]
opt-level = 3
codegen-units = 1
[profile.release.build-override]
opt-level = 3
codegen-units = 1
[[bin]]
name = "day00"
path = "src/day00/main.rs"

1
rust/src/day00/input.txt Normal file
View file

@ -0,0 +1 @@
Placeholder input

11
rust/src/day00/main.rs Normal file
View file

@ -0,0 +1,11 @@
const INPUT: &str = include_str!("input.txt");
mod part_1;
use part_1::part_1;
mod part_2;
use part_2::part_2;
pub fn main() {
part_1(INPUT);
part_2(INPUT);
}

3
rust/src/day00/part_1.rs Normal file
View file

@ -0,0 +1,3 @@
pub(crate) fn part_1(input: &'static str) {
println!("Part 1 {input}")
}

3
rust/src/day00/part_2.rs Normal file
View file

@ -0,0 +1,3 @@
pub(crate) fn part_2(input: &'static str) {
println!("Part 2 {input}")
}