Skip to content

Commit 085ff53

Browse files
committed
chore(rust): remove doc tests since we don't have input in ci
1 parent 6e79692 commit 085ff53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+55
-677
lines changed

rust/2015/src/day_01.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ pub fn input_generator(input: &str) -> Input {
2222

2323
/* Part One
2424
*/
25-
/// Your puzzle answer was
26-
/// ```
27-
/// use advent_of_code_2015::day_01::*;
28-
/// let data = include_str!("../input/2015/day1.txt");
29-
/// assert_eq!(solve_part_01(&input_generator(data)), 232);
30-
/// ```
3125
#[aoc(day1, part1)]
3226
pub fn solve_part_01(directions: &Input) -> isize {
3327
directions
@@ -41,12 +35,6 @@ pub fn solve_part_01(directions: &Input) -> isize {
4135

4236
/* Part Two
4337
*/
44-
/// Your puzzle answer was
45-
/// ```
46-
/// use advent_of_code_2015::day_01::*;
47-
/// let data = include_str!("../input/2015/day1.txt");
48-
/// assert_eq!(solve_part_02(&input_generator(data)), 1783);
49-
/// ```
5038
#[aoc(day1, part2)]
5139
pub fn solve_part_02(directions: &Input) -> usize {
5240
let mut floor = 0;

rust/2015/src/day_02.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ A present with dimensions 1x1x10 requires 2*1 + 2*10 + 2*10 = 42 square feet of
3131
All numbers in the elves' list are in feet. How many total square feet of wrapping paper should they order?
3232
3333
*/
34-
// Your puzzle answer was
35-
/// ```
36-
/// use advent_of_code_2015::day_02::*;
37-
/// let data = include_str!("../input/2015/day2.txt");
38-
/// assert_eq!(solve_part_01(&input_generator(data)), 1586300);
39-
/// ```
4034
#[aoc(day2, part1)]
4135
pub fn solve_part_01(input: &[(u32, u32, u32)]) -> u32 {
4236
input.iter().fold(0, |sum, (length, width, height)| {
@@ -62,12 +56,6 @@ A present with dimensions 1x1x10 requires 1+1+1+1 = 4 feet of ribbon to wrap the
6256
6357
How many total feet of ribbon should they order?
6458
*/
65-
// Your puzzle answer was
66-
/// ```
67-
/// use advent_of_code_2015::day_02::*;
68-
/// let data = include_str!("../input/2015/day2.txt");
69-
/// assert_eq!(solve_part_02(&input_generator(data)), 3737498);
70-
/// ```
7159
#[aoc(day2, part2)]
7260
pub fn solve_part_02(input: &[(u32, u32, u32)]) -> u32 {
7361
input.iter().fold(0, |sum, (length, width, height)| {

rust/2015/src/day_03.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ pub fn input_generator(input: &str) -> Input {
6060

6161
/* Part One
6262
*/
63-
/// Your puzzle answer was
64-
/// ```
65-
/// use advent_of_code_2015::day_03::*;
66-
/// let data = include_str!("../input/2015/day3.txt");
67-
/// assert_eq!(solve_part_01(&input_generator(data)), 2572);
68-
/// ```
6963
#[aoc(day3, part1)]
7064
pub fn solve_part_01(input: &Input) -> usize {
7165
let mut houses: HashSet<(isize, isize)> = HashSet::with_capacity(input.len());
@@ -83,12 +77,6 @@ pub fn solve_part_01(input: &Input) -> usize {
8377

8478
/* Part Two
8579
*/
86-
/// Your puzzle answer was
87-
/// ```
88-
/// use advent_of_code_2015::day_03::*;
89-
/// let data = include_str!("../input/2015/day3.txt");
90-
/// assert_eq!(solve_part_02(&input_generator(data)), 2631);
91-
/// ```
9280
#[aoc(day3, part2)]
9381
pub fn solve_part_02(input: &Input) -> usize {
9482
let mut houses: HashSet<(isize, isize)> = HashSet::with_capacity(input.len());

rust/2016/src/day_01.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ pub fn input_generator(input: &str) -> Vec<Instruction> {
8080

8181
/* Part One
8282
*/
83-
/// Your puzzle answer was
84-
/// ```
85-
/// use advent_of_code_2016::day_01::*;
86-
/// let input = include_str!("../input/2016/day1.txt");
87-
/// assert_eq!(solve_part_01(&input_generator(input)), 252);
8883
#[aoc(day1, part1)]
8984
pub fn solve_part_01(instructions: &[Instruction]) -> u32 {
9085
let mut cab = Cab::new();

rust/2016/src/day_03.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ pub fn input_generator(input: &str) -> Input {
1414

1515
/* Part One
1616
*/
17-
/// Your puzzle answer was
18-
/// ```
19-
/// use advent_of_code_2016::day_03::*;
20-
/// let data = include_str!("../input/2016/day3.txt");
21-
/// assert_eq!(solve_part_01(&input_generator(data)), 862);
22-
/// ```
2317
#[aoc(day3, part1)]
2418
pub fn solve_part_01(input: &Input) -> usize {
2519
input

rust/2019/src/day_01.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,13 @@ fn calculate_fuel_with_extra(mass: &i32, total_fuel: i32) -> i32 {
2020

2121
/* Part One
2222
*/
23-
/// Your puzzle answer was
24-
/// ```
25-
/// use advent_of_code_2019::day_01::*;
26-
/// let data = include_str!("../input/2019/day1.txt");
27-
/// assert_eq!(solve_part_01(&input_generator(data)), 3553700);
28-
/// ```
2923
#[aoc(day1, part1)]
3024
pub fn solve_part_01(fuel: &Fuel) -> i32 {
3125
fuel.iter().map(calculate_fuel).sum()
3226
}
3327

3428
/* Part Two
3529
*/
36-
/// Your puzzle answer was
37-
/// ```
38-
/// use advent_of_code_2019::day_01::*;
39-
/// let data = include_str!("../input/2019/day1.txt");
40-
/// assert_eq!(solve_part_02(&input_generator(data)), 5327664);
41-
/// ```
4230
#[aoc(day1, part2)]
4331
pub fn solve_part_02(fuel: &Fuel) -> i32 {
4432
fuel.iter().map(|f| calculate_fuel_with_extra(f, 0)).sum()

rust/2020/src/day_01.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ pub fn input_generator(input: &str) -> HashSet<u32> {
3737
*
3838
* Of course, your expense report is much larger. Find the two entries that sum to 2020; what do you get if you multiply them together?
3939
*/
40-
/// Your puzzle answer was
41-
/// ```
42-
/// use advent_of_code_2020::day_01::*;
43-
/// let data = include_str!("../input/2020/day1.txt");
44-
/// assert_eq!(solve_part_01(&input_generator(data)), 898299);
45-
/// ```
4640
#[aoc(day1, part1)]
4741
pub fn solve_part_01(input: &HashSet<u32>) -> u32 {
4842
for x in input {
@@ -66,12 +60,6 @@ pub fn solve_part_01(input: &HashSet<u32>) -> u32 {
6660
*
6761
* In your expense report, what is the product of the three entries that sum to 2020?
6862
*/
69-
/// Your puzzle answer was
70-
/// ```
71-
/// use advent_of_code_2020::day_01::*;
72-
/// let data = include_str!("../input/2020/day1.txt");
73-
/// assert_eq!(solve_part_02(&input_generator(data)), 143933922);
74-
/// ```
7563
#[aoc(day1, part2)]
7664
pub fn solve_part_02(input: &HashSet<u32>) -> u32 {
7765
for x in input {

rust/2020/src/day_02.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use std::ops::RangeInclusive;
99
// Fastest, also a very clean solution, seems to be using a RegEx
1010

1111
lazy_static! {
12-
/// Input is in the form "1-3 a: abcdef"
12+
// Input is in the form "1-3 a: abcdef"
1313
static ref RE: Regex = Regex::new(r"(\d+)-(\d+) (\w): (\w*)").unwrap();
1414
}
1515

16-
/// Official Toboggan Corporate Policy
16+
// Official Toboggan Corporate Policy
1717
pub struct OTCP {
1818
password: String,
1919
policy: char,
@@ -78,12 +78,6 @@ pub fn input_generator(input: &str) -> Vec<OTCP> {
7878
*
7979
* How many passwords are valid according to their policies?
8080
*/
81-
///Your puzzle answer was
82-
/// ```
83-
/// use advent_of_code_2020::day_02::*;
84-
/// let input = include_str!("../input/2020/day2.txt");
85-
/// assert_eq!(solve_part_01(&input_generator(input)), 524);
86-
/// ```
8781
#[aoc(day2, part1)]
8882
pub fn solve_part_01(input: &[OTCP]) -> usize {
8983
input
@@ -117,12 +111,6 @@ pub fn solve_part_01(input: &[OTCP]) -> usize {
117111
*
118112
* How many passwords are valid according to the new interpretation of the policies?
119113
*/
120-
///your puzzle answer was
121-
/// ```
122-
/// use advent_of_code_2020::day_02::*;
123-
/// let input = include_str!("../input/2020/day2.txt");
124-
/// assert_eq!(solve_part_02(&input_generator(input)), 485);
125-
/// ```
126114
#[aoc(day2, part2)]
127115
pub fn solve_part_02(input: &[OTCP]) -> usize {
128116
input
@@ -141,7 +129,7 @@ pub fn solve_part_02(input: &[OTCP]) -> usize {
141129
mod tests {
142130
use super::*;
143131

144-
/// Test example data on part 1
132+
// Test example data on part 1
145133
#[test]
146134
fn sample_01() {
147135
let data = "
@@ -153,7 +141,7 @@ mod tests {
153141
assert_eq!(solve_part_01(&input_generator(data)), 2)
154142
}
155143

156-
/// Test example data on part 2
144+
// Test example data on part 2
157145
#[test]
158146
fn sample_02() {
159147
let data = "

rust/2020/src/day_03.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ fn slope_finder(input: &[String], rs: &usize, cs: &usize) -> u32 {
9191
*
9292
* Starting at the top-left corner of your map and following a slope of right 3 and down 1, how many trees would you encounter?
9393
*/
94-
///your puzzle answer was.
95-
/// ```
96-
/// use advent_of_code_2020::day_03::*;
97-
/// let input = include_str!("../input/2020/day3.txt");
98-
/// assert_eq!(solve_part_01(&input_generator(input)), 259);
99-
/// ```
10094
#[aoc(day3, part1)]
10195
pub fn solve_part_01(input: &[String]) -> u32 {
10296
slope_finder(input, &1, &3)
@@ -120,12 +114,6 @@ pub fn solve_part_01(input: &[String]) -> u32 {
120114
*
121115
* What do you get if you multiply together the number of trees encountered on each of the listed slopes?
122116
*/
123-
///your puzzle answer was.
124-
/// ```
125-
/// use advent_of_code_2020::day_03::*;
126-
/// let input = include_str!("../input/2020/day3.txt");
127-
/// assert_eq!(solve_part_02(&input_generator(input)), 2224913600);
128-
/// ```
129117
#[aoc(day3, part2)]
130118
pub fn solve_part_02(input: &[String]) -> u32 {
131119
[(1, 1), (1, 3), (1, 5), (1, 7), (2, 1)]
@@ -137,7 +125,7 @@ pub fn solve_part_02(input: &[String]) -> u32 {
137125
mod tests {
138126
use super::*;
139127

140-
/// Test example data on part 1
128+
// Test example data on part 1
141129
#[test]
142130
fn sample_01() {
143131
let data = "
@@ -157,7 +145,7 @@ mod tests {
157145
assert_eq!(solve_part_01(&input_generator(data)), 7)
158146
}
159147

160-
/// Test example data on part 2
148+
// Test example data on part 2
161149
#[test]
162150
fn sample_02() {
163151
let data = "

rust/2020/src/day_04.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ pub fn input_generator_part_02(input: &str) -> Vec<Passport> {
8181
* Count the number of valid passports - those that have all required fields.
8282
* Treat cid as optional. In your batch file, how many passports are valid?
8383
*/
84-
///your puzzle answer was.
85-
/// ```
86-
/// use advent_of_code_2020::day_04::*;
87-
/// let input = include_str!("../input/2020/day4.txt");
88-
/// assert_eq!(solve_part_01(&input_generator_part_01(input)), 200);
89-
/// ```
9084
#[aoc(day4, part1)]
9185
pub fn solve_part_01(input: &[Passport]) -> usize {
9286
input
@@ -165,12 +159,6 @@ pub fn solve_part_01(input: &[Passport]) -> usize {
165159
* Count the number of valid passports - those that have all required fields and valid values.
166160
* Continue to treat cid as optional. In your batch file, how many passports are valid?
167161
*/
168-
///your puzzle answer was.
169-
/// ```
170-
/// use advent_of_code_2020::day_04::*;
171-
/// let input = include_str!("../input/2020/day4.txt");
172-
/// assert_eq!(solve_part_02(&input_generator_part_02(input)), 116);
173-
/// ```
174162
#[aoc(day4, part2)]
175163
pub fn solve_part_02(input: &[Passport]) -> usize {
176164
input.iter().filter(|passport| passport.is_valid()).count()
@@ -180,7 +168,7 @@ pub fn solve_part_02(input: &[Passport]) -> usize {
180168
mod tests {
181169
use super::*;
182170

183-
/// Test example data on part 1
171+
// Test example data on part 1
184172
#[test]
185173
fn sample_01() {
186174
let data = "
@@ -202,7 +190,7 @@ iyr:2011 ecl:brn hgt:59in
202190
assert_eq!(solve_part_01(&input_generator_part_01(data)), 2)
203191
}
204192

205-
/// Test example data on part 2
193+
// Test example data on part 2
206194
#[test]
207195
fn sample_data_invalid_02() {
208196
let data = "

rust/2020/src/day_05.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ fn find_airplane_seats(input: &[String]) -> Vec<u32> {
9797
* BBFFBBFRLL: row 102, column 4, seat ID 820.
9898
* As a sanity check, look through your list of boarding passes. What is the highest seat ID on a boarding pass?
9999
*/
100-
///your puzzle answer was.
101-
/// ```
102-
/// use advent_of_code_2020::day_05::*;
103-
/// let input = include_str!("../input/2020/day5.txt");
104-
/// assert_eq!(solve_part_01(&input_generator(input)), 866);
105-
/// ```
106100
#[aoc(day5, part1)]
107101
pub fn solve_part_01(input: &[String]) -> u32 {
108102
find_airplane_seats(input).into_iter().max().unwrap()
@@ -120,12 +114,6 @@ pub fn solve_part_01(input: &[String]) -> u32 {
120114
*
121115
* What is the ID of your seat?
122116
*/
123-
///your puzzle answer was.
124-
/// ```
125-
/// use advent_of_code_2020::day_05::*;
126-
/// let input = include_str!("../input/2020/day5.txt");
127-
/// assert_eq!(solve_part_02(&input_generator(input)), 583);
128-
/// ```
129117
#[aoc(day5, part2)]
130118
pub fn solve_part_02(input: &[String]) -> u32 {
131119
let mut my_seat = 0;
@@ -145,7 +133,7 @@ pub fn solve_part_02(input: &[String]) -> u32 {
145133
mod tests {
146134
use super::*;
147135

148-
/// Test example data on part 1
136+
// Test example data on part 1
149137
#[test]
150138
fn sample_01() {
151139
let data = "FBFBBFFRLR";

rust/2020/src/day_06.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ pub fn input_generator_part_02(input: &str) -> Vec<Vec<String>> {
8383
*
8484
* For each group, count the number of questions to which anyone answered "yes". What is the sum of those counts?
8585
*/
86-
///your puzzle answer was.
87-
/// ```
88-
/// use advent_of_code_2020::day_06::*;
89-
/// let input = include_str!("../input/2020/day6.txt");
90-
/// assert_eq!(solve_part_01(&input_generator_part_01(input)), 6778);
91-
/// ```
9286
#[aoc(day6, part1)]
9387
pub fn solve_part_01(input: &[String]) -> usize {
9488
input
@@ -131,12 +125,6 @@ pub fn solve_part_01(input: &[String]) -> usize {
131125
*
132126
* For each group, count the number of questions to which everyone answered "yes". What is the sum of those counts?
133127
*/
134-
///your puzzle answer was.
135-
/// ```
136-
/// use advent_of_code_2020::day_06::*;
137-
/// let input = include_str!("../input/2020/day6.txt");
138-
/// assert_eq!(solve_part_02(&input_generator_part_02(input)), 3406);
139-
/// ```
140128
#[aoc(day6, part2)]
141129
pub fn solve_part_02(input: &[Vec<String>]) -> usize {
142130
input.iter().fold(0, |acc, group| {
@@ -168,7 +156,7 @@ pub fn solve_part_02(input: &[Vec<String>]) -> usize {
168156
mod tests {
169157
use super::*;
170158

171-
/// Test example data on part 1
159+
// Test example data on part 1
172160
#[test]
173161
fn sample_01() {
174162
let data = "
@@ -191,7 +179,7 @@ b
191179

192180
assert_eq!(solve_part_01(&input_generator_part_01(data)), 11)
193181
}
194-
/// Test example data on part 2
182+
// Test example data on part 2
195183
#[test]
196184
fn sample_02() {
197185
let data = "

0 commit comments

Comments
 (0)