Skip to content

Commit 9a47670

Browse files
committed
Clippy doc lint
1 parent 128ac34 commit 9a47670

File tree

15 files changed

+28
-26
lines changed

15 files changed

+28
-26
lines changed

src/util/grid.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! ```
1818
//!
1919
//! A convenience [`parse`] method creates a `Grid` directly from a 2 dimenionsal set of
20-
//! ASCII characters, a common occurence in AoC inputs. The [`default_copy`] function creates a
21-
//! grid of the same size, that can be used for in BFS algorithms for tracking visited location
22-
//! or for tracking cost in Djikstra.
20+
//! ASCII characters, a common occurence in Advent of Code inputs. The [`default_copy`] function
21+
//! creates a grid of the same size, that can be used for in BFS algorithms for tracking visited
22+
//! location or for tracking cost in Djikstra.
2323
//!
2424
//! [`Point`]: crate::util::point
2525
//! [`parse`]: Grid::parse

src/util/parse.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
//! Extracts and parses signed and unsigned integers from surrounding text and whitespace.
22
//!
3-
//! A common pattern in AoC is to parse and return `123`, `456` and `789` from input resembling:
3+
//! A common pattern in Advent of Code is to parse and return `123`, `456` and `789` from input
4+
//! resembling:
45
//!
56
//! ```none
67
//! Lorem ipsum 123 dolor 456 sit 789 amet
78
//! ```
89
//!
910
//! This module provides two [`&str`] extension methods [`iter_signed`] and [`iter_unsigned`]. The
10-
//! reason for the separate methods is that some AoC inputs contains the `-` character as a
11-
//! delimeter and this would cause numbers to be incorrectly parsed as negative.
11+
//! reason for the separate methods is that some Advent of Code inputs contains the `-` character
12+
//! as a delimeter and this would cause numbers to be incorrectly parsed as negative.
1213
//!
1314
//! [`iter_unsigned`]: ParseOps::iter_unsigned
1415
//! [`iter_signed`]: ParseOps::iter_signed

src/util/point.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Comprehensive 2 dimensional point implementation. This class is designed to work together
22
//! with the [`Grid`] class.
33
//!
4-
//! A common theme in AoC is operations in 2 dimensions. This module provides a [`Point`] struct
5-
//! along with implementations of several of the [`std::ops`] traits to support
4+
//! A common theme in Advent of Code is operations in 2 dimensions. This module provides a
5+
//! [`Point`] struct along with implementations of several of the [`std::ops`] traits to support
66
//! operator overloading, that allows shorthand expressions such as:
77
//!
88
//! ```

src/year2015/day10.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! # Elves Look, Elves Say
22
//!
33
//! There is a trick to solve this problem in constant time and space. While this is not possible
4-
//! for any arbitrary sequence, in AoC *we only need to solve for our given input*.
4+
//! for any arbitrary sequence, in Advent of Code *we only need to solve for our given input*.
55
//!
66
//! Examining the input shows that it consists of one of Conway's
77
//! [atomic elements](https://en.wikipedia.org/wiki/Look-and-say_sequence#Cosmological_decay).

src/year2020/day03.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! # Toboggan Trajectory
22
//!
3-
//! Two dimensional grids of ASCII characters are a common AoC theme, so we use our utility
4-
//! [`Grid`] class to parse the data.
3+
//! Two dimensional grids of ASCII characters are a common Advent of Code theme,
4+
//! so we use our utility [`Grid`] class to parse the data.
55
//!
66
//! [`Grid`]: crate::util::grid
77
use crate::util::grid::*;

src/year2020/day19.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
//!
5050
//! For example `42 42 31` or `42 42 42 31` or `42 42 42 31 31` matches but *not* `42 42 31 31`.
5151
//!
52-
//! Since we don't need to handle the general input case (a common pattern in AoC) we can
52+
//! Since we don't need to handle the general input case (a common pattern in Advent of Code) we can
5353
//! implement this rule directly in code.
5454
use crate::util::parse::*;
5555
use Rule::*;

src/year2020/day22.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! circular buffer. Why use our own implementation when there is a perfectly good [`VecDeque`]
66
//! already available? The answer is speed. As there are at most fifty cards in the pack, the Deck
77
//! can use a fix sized stack allocated array, avoiding the expensive heap allocations that
8-
//! VecDeque must use.
8+
//! [`VecDeque`] must use.
99
//!
1010
//! `Deck` also keeps the score up to date as cards are added and removed, as this comes in useful
1111
//! during part two. To update the score when a card is removed we subtract the card's value

src/year2021/day02.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! # Dive!
22
//!
33
//! Both part 1 and part 2 rely on the [`fold`] method. This method comes in useful for a lot
4-
//! of AoC problems so is handy to know about. The input is parsed into a tuple enum [`Sub`] for
5-
//! convenience.
4+
//! of Advent of Code problems so is handy to know about. The input is parsed into a tuple enum
5+
//! [`Sub`] for convenience.
66
//!
77
//! [`fold`]: Iterator::fold
88
use crate::util::iter::*;

src/year2021/day09.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//! such as a [`VecDeque`].
88
//!
99
//! This solution uses a DFS approach as it's faster and Rust's stack size limit seems enough
10-
//! to accommodate the maximum basin size. 2 dimensional grids are common in AoC problems so we
11-
//! use our utility [`Grid`] and [`Point`] modules.
10+
//! to accommodate the maximum basin size. 2 dimensional grids are common in Advent of Code
11+
//! problems so we use our utility [`Grid`] and [`Point`] modules.
1212
//!
1313
//! [`VecDeque`]: std::collections::VecDeque
1414
//! [`Grid`]: crate::util::grid

src/year2022/day04.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Pairs = [u32; 4];
2424
/// Parse each line into 4 integers.
2525
///
2626
/// Notes:
27-
/// * Extracting integers from redundant text is a very common theme in AoC that
27+
/// * Extracting integers from redundant text is a very common theme in Advent of Code that
2828
/// the [`iter_unsigned`] method handles.
2929
///
3030
/// [`iter_unsigned`]: ParseOps::iter_unsigned

src/year2022/day06.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
///
1616
/// Notes:
1717
/// * We need to [`trim`] to remove the trailing newline character
18-
/// * AoC input is always ASCII characters, so casting to an `u8` slice is acceptable.
18+
/// * Advent of Code input is always ASCII characters, so casting to an `u8` slice is acceptable.
1919
///
2020
/// [`trim`]: str::trim
2121
pub fn parse(input: &str) -> Vec<usize> {

src/year2022/day07.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! # No Space Left On Device
22
//!
33
//! Some up-front analysis of the input data helps us develop an efficient solving algorithm (this
4-
//! is a regular theme in AoC!). Looking at the directory commands shows 2 key insights:
4+
//! is a regular theme in Advent of Code!). Looking at the directory commands shows 2 key insights:
55
//! * We never return to a previously visited directory
66
//! * Directory traversal is only up or down in steps of one.
77
//!

src/year2022/day09.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//! # Rope Bridge
22
//!
3-
//! This solution relies on the [`Point`] utility class. Two dimensional problems are common in AoC,
4-
//! so having a decent `Point` (or `Coord` or `Pos`) class in your back pocket is handy.
3+
//! This solution relies on the [`Point`] utility class. Two dimensional problems are common in
4+
//! Advent of Code, so having a decent `Point` (or `Coord` or `Pos`) class in your back pocket
5+
//! is handy.
56
use crate::util::iter::*;
67
use crate::util::parse::*;
78
use crate::util::point::*;

src/year2022/day11.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! # Monkey in the Middle
22
//!
3-
//! This problem is the combination of 2 AoC classics, extracting numbers from a wall of
4-
//! flavor text and modular arithmetic. For the first problem, our utility [`iter_unsigned`] method
5-
//! comes in handy.
3+
//! This problem is the combination of two Advent of Code classics, extracting numbers from a wall
4+
//! of flavor text and modular arithmetic. For the first problem, our utility [`iter_unsigned`]
5+
//! method comes in handy.
66
//!
77
//! For the second problem, the key insight for part 2 is that
88
//! `a % m` is the same as `(a % n) % m` if `m` is a factor of `n`.

src/year2022/day12.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! Pretty much textbook implementation of a BFS (Breadth First Search). If you're not familar with
44
//! BFS, [this blog post is a great introduction](https://www.redblobgames.com/pathfinding/a-star/introduction.html)
5-
//! to the algorithm, plus some others that come in handy for AoC.
5+
//! to the algorithm, plus some others that come in handy for Advent of Code.
66
//!
77
//! Implementation notes:
88
//! * A [`VecDeque`] of [`Point`] is used to store the frontier as it gives better performance

0 commit comments

Comments
 (0)