-
Notifications
You must be signed in to change notification settings - Fork 0
/
day8.rs
54 lines (44 loc) · 1.35 KB
/
day8.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// vi: set shiftwidth=4 tabstop=4 expandtab:
use common::input::check_answer;
use common::input::get_answers;
use common::input::get_first_line_from_file;
use std::time::Instant;
const INPUT_FILEPATH: &str = "../resources/year2019_day8_input.txt";
const ANSWERS_FILEPATH: &str = "../resources/year2019_day8_answer.txt";
type Int = u32;
type InputContent = String;
fn get_input_from_str(string: &str) -> InputContent {
string.to_owned()
}
#[expect(clippy::missing_const_for_fn, reason = "Not implemented yet")]
fn part1(_arg: &InputContent) -> Int {
0
}
#[expect(clippy::missing_const_for_fn, reason = "Not implemented yet")]
fn part2(_arg: &InputContent) -> Int {
0
}
fn main() {
let before = Instant::now();
let data = get_input_from_str(&get_first_line_from_file(INPUT_FILEPATH));
let (ans, ans2) = get_answers(ANSWERS_FILEPATH);
let solved = false;
let res = part1(&data);
check_answer(&res.to_string(), ans, solved);
let res2 = part2(&data);
check_answer(&res2.to_string(), ans2, solved);
println!("Elapsed time: {:.2?}", before.elapsed());
}
#[cfg(test)]
mod tests {
use super::*;
const EXAMPLE: &str = "";
#[test]
fn test_part1() {
assert_eq!(part1(&get_input_from_str(EXAMPLE)), 0);
}
#[test]
fn test_part2() {
assert_eq!(part2(&get_input_from_str(EXAMPLE)), 0);
}
}