Skip to content

Commit 3e10f18

Browse files
committed
Comment linting
1 parent fd4fa59 commit 3e10f18

38 files changed

+54
-54
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
I hope that you've enjoyed reading these solutions as much as I enjoyed writing them.
44
They're pretty fast and clean...but can you make them even *faster and cleaner*?
55

6-
If you've made an improvement then please
6+
If you've made an improvement, then please
77
[open a pull request](https://github.com/maneatingape/advent-of-code-rust/compare).
88
Contributions are encouraged and valued. ❤️
99

src/util/grid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
//!
1919
//! A convenience [`parse`] method creates a `Grid` directly from a 2 dimensional set of
2020
//! ASCII characters, a common occurrence in Advent of Code inputs. The [`same_size_with`] 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 Dijkstra.
21+
//! creates a grid of the same size that can be used in BFS algorithms for tracking visited
22+
//! locations or for tracking cost in Dijkstra.
2323
//!
2424
//! [`Point`]: crate::util::point
2525
//! [`parse`]: Grid::parse

src/util/math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! * [Least common multiple](https://en.wikipedia.org/wiki/Least_common_multiple)
88
//!
9-
//! * [Modular exponentation](https://en.wikipedia.org/wiki/Modular_exponentiation).
9+
//! * [Modular exponentiation](https://en.wikipedia.org/wiki/Modular_exponentiation).
1010
//! Calculates bᵉ mod m efficiently using
1111
//! [exponentiation by squaring](https://en.wikipedia.org/wiki/Exponentiation_by_squaring).
1212
//!

src/util/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//! ```
99
//!
1010
//! This module provides two [`&str`] extension methods [`iter_signed`] and [`iter_unsigned`]. The
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.
11+
//! reason for the separate methods is that some Advent of Code inputs contain the `-` character
12+
//! as a delimiter and this would cause numbers to be incorrectly parsed as negative.
1313
//!
1414
//! [`iter_unsigned`]: ParseOps::iter_unsigned
1515
//! [`iter_signed`]: ParseOps::iter_signed

src/util/thread.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Utility methods to spawn a number of
22
//! [scoped](https://doc.rust-lang.org/stable/std/thread/fn.scope.html)
3-
//! threads equals to the number of cores on the machine. Unlike normal threads, scoped threads
3+
//! threads equal to the number of cores on the machine. Unlike normal threads, scoped threads
44
//! can borrow data from their environment.
55
use std::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering::Relaxed};
66
use std::thread::*;
@@ -31,7 +31,7 @@ where
3131
/// Spawns `n` scoped threads that each receive a
3232
/// [work stealing](https://en.wikipedia.org/wiki/Work_stealing) iterator.
3333
/// Work stealing is an efficient strategy that keeps each CPU core busy when some items take longer
34-
/// than other to process, used by popular libraries such as [rayon](https://github.com/rayon-rs/rayon).
34+
/// than others to process, used by popular libraries such as [rayon](https://github.com/rayon-rs/rayon).
3535
/// Processing at different rates also happens on many modern CPUs with
3636
/// [heterogeneous performance and efficiency cores](https://en.wikipedia.org/wiki/ARM_big.LITTLE).
3737
pub fn spawn_parallel_iterator<F, R, T>(items: &[T], f: F) -> Vec<R>
@@ -43,7 +43,7 @@ where
4343
let threads = threads();
4444
let size = items.len().div_ceil(threads);
4545

46-
// Initially divide work as evenly as possible amongst each worker thread.
46+
// Initially divide work as evenly as possible among each worker thread.
4747
let workers: Vec<_> = (0..threads)
4848
.map(|id| {
4949
let start = (id * size).min(items.len());

src/year2015/day07.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! # Some Assembly Required
22
//!
33
//! To obtain the result we recursively compute the inputs starting at gate `a` and working
4-
//! backwards. To make things faster we memoize the result of each wire in a cache, so that each
4+
//! backward. To make things faster we memoize the result of each wire in a cache, so that each
55
//! wire is computed at most once.
66
//!
77
//! For part two we pre-seed the value of `b` in the cache with the result from part one then

src/year2015/day23.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! [3n + 1 sequence](https://en.wikipedia.org/wiki/Collatz_conjecture)
55
//! for one of two different numbers chosen depending on whether `a` is 0 or 1.
66
//!
7-
//! The code fast enough to emulate directly without needing any understanding of what it's doing.
7+
//! The code is fast enough to emulate directly without needing any understanding of what it's doing.
88
use crate::util::parse::*;
99

1010
pub enum Op {

src/year2015/day25.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//!
2323
//! Starting at the chosen number 12 and moving diagonally upwards to the right we intersect
2424
//! the top row at column `column + row - 1 = 2 + 4 - 1 = 5`. This gives the triangular number
25-
//! `5 * (5 + 1) / 2 = 15`. Then we count backwards by `row` elements to get the one less
25+
//! `5 * (5 + 1) / 2 = 15`. Then we count backward by `row` elements to get the one less
2626
//! zero based based index `15 - 4 = 11`.
2727
//!
2828
//! The second part is realizing that the description of the code generation is

src/year2016/day12.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This problem is interesting in that the solution is all about *reading* code not writing code.
44
//!
55
//! We could implement a brute force virtual machine without understanding the underlying code
6-
//! but it's much more efficient to analyse the code instead.
6+
//! but it's much more efficient to analyze the code instead.
77
//!
88
//! The first thing we notice is that the following idiom is repeated several times:
99
//!

src/year2016/day19.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! The title is a reference to the [Josephus problem](https://en.wikipedia.org/wiki/Josephus_problem).
44
//! We can solve both parts efficiently in `O(1)` constant storage without needing any
5-
//! auxiliary data strucutres.
5+
//! auxiliary data structures.
66
//!
77
//! ## Part One
88
//!
@@ -58,12 +58,12 @@
5858
//!
5959
//! Part two is a variant of the problem. We solve in `log(n)` time by working *backwards*
6060
//! from the winning elf until we reach the starting number of elves.
61-
//! Starting with the winning elf `a` it must have eliminated its neighbour to the right:
61+
//! Starting with the winning elf `a` it must have eliminated its neighbor to the right:
6262
//!
6363
//! `a` => `a b`
6464
//!
6565
//! We then choose the previous elf to the left wrapping around to elf `b` in this case. Elf `b`
66-
//! must have eliminated its neighbour 1 step to the right:
66+
//! must have eliminated its neighbor 1 step to the right:
6767
//!
6868
//! `a b` => `a b c`
6969
//!

0 commit comments

Comments
 (0)