File tree Expand file tree Collapse file tree 7 files changed +64
-0
lines changed Expand file tree Collapse file tree 7 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ #[ cfg( test) ]
2+ pub const EXAMPLE1 : & ' static str = include_str ! ( "../data/example1" ) ;
3+
4+ #[ allow( unused) ]
5+ pub const INPUT : & ' static str = include_str ! ( "../data/input" ) ;
Original file line number Diff line number Diff line change 1+ mod data;
2+ mod part1;
3+ mod part2;
4+ mod puzzle;
5+
6+ fn main ( ) {
7+ use data:: INPUT ;
8+ println ! ( "Part 1: {}" , part1:: run( INPUT ) ) ;
9+ println ! ( "Part 2: {}" , part2:: run( INPUT ) ) ;
10+ }
Original file line number Diff line number Diff line change 1+ use crate :: puzzle:: Puzzle ;
2+
3+ pub fn run ( input : & str ) -> usize {
4+ let puzzle: Puzzle = input. parse ( ) . expect ( "parse failed" ) ;
5+ todo ! ( "Implement Part 1" )
6+ }
7+
8+ #[ cfg( test) ]
9+ mod test {
10+ use super :: * ;
11+ use crate :: data:: EXAMPLE1 ;
12+
13+ #[ test]
14+ fn test1 ( ) {
15+ assert_eq ! ( run( EXAMPLE1 ) , todo!( ) ) ;
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ use crate :: puzzle:: Puzzle ;
2+
3+ pub fn run ( input : & str ) -> usize {
4+ let puzzle: Puzzle = input. parse ( ) . expect ( "parse failed" ) ;
5+ todo ! ( "Implement Part 2" )
6+ }
7+
8+ #[ cfg( test) ]
9+ mod test {
10+ use super :: * ;
11+ use crate :: data:: EXAMPLE1 ;
12+
13+ #[ test]
14+ fn test1 ( ) {
15+ assert_eq ! ( run( EXAMPLE1 ) , todo!( ) ) ;
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ use std:: str:: FromStr ;
2+
3+ #[ derive( Debug ) ]
4+ pub struct Puzzle { }
5+
6+ #[ derive( Debug ) ]
7+ pub struct ParseError ;
8+
9+ impl FromStr for Puzzle {
10+ type Err = ParseError ;
11+
12+ fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
13+ todo ! ( )
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments