-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.rs
60 lines (46 loc) · 1.07 KB
/
template.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
55
56
57
58
59
60
//! [Advent of Code Day DAYNUM](https://adventofcode.com/2024/day/DAYNUM)
use crate::prelude::*;
pub fn part1(input: &str) -> Result<u32> {
todo!("Implement Part1");
}
pub fn part2(input: &str) -> Result<u32> {
todo!("Implement Part2");
}
#[derive(Debug, Clone)]
struct Line {}
impl Line {}
static RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"PATTERN").unwrap());
impl FromStr for Line {
type Err = Error;
fn from_str(s: &str) -> Result<Self> {
let _caps = RE
.captures(s)
.ok_or_else(|| format_err!("Invalid line: {s}"))?;
todo!("Implement Line::from_str")
}
}
#[cfg(test)]
mod test {
use super::*;
use indoc::indoc;
const SAMPLE: &str = indoc! {"
sample
data
"};
#[test]
fn test_parse() {
assert_eq!(true, false);
}
#[test]
fn test_part1() {
assert_eq!(part1(SAMPLE).unwrap(), 0);
}
// #[test]
// fn test_part2() {
// assert_eq!(part2(SAMPLE).unwrap(), 0);
// }
}
#[cfg(feature = "bench")]
mod bench {
bench_day!(DAYNUM);
}