Skip to content

Commit f4e5f5b

Browse files
committed
Comment linting
1 parent 29ec867 commit f4e5f5b

38 files changed

+58
-58
lines changed

src/util/hash.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::ops::BitXor as _;
1111
/// Type alias for [`HashSet`] using [`FxHasher`].
1212
pub type FastSet<T> = HashSet<T, BuildFxHasher>;
1313

14-
/// Convenience methods to contruct a [`FastSet`].
14+
/// Convenience methods to construct a [`FastSet`].
1515
pub trait FastSetBuilder<T> {
1616
fn new() -> Self;
1717
fn with_capacity(capacity: usize) -> Self;
@@ -37,7 +37,7 @@ impl<T: Eq + Hash> FastSetBuilder<T> for FastSet<T> {
3737
/// Type alias for [`HashMap`] using [`FxHasher`].
3838
pub type FastMap<K, V> = HashMap<K, V, BuildFxHasher>;
3939

40-
/// Convenience methods to contruct a [`FastMap`].
40+
/// Convenience methods to construct a [`FastMap`].
4141
pub trait FastMapBuilder<K, V> {
4242
fn new() -> Self;
4343
fn with_capacity(capacity: usize) -> Self;
@@ -75,7 +75,7 @@ impl BuildHasher for BuildFxHasher {
7575

7676
/// Simplified implementation, in particular running on a system with 64 bit `usize` is assumed.
7777
///
78-
/// Checkout the [Firefox code](https://searchfox.org/mozilla-central/rev/633345116df55e2d37be9be6555aa739656c5a7d/mfbt/HashFunctions.h#109-153)
78+
/// Check out the [Firefox code](https://searchfox.org/mozilla-central/rev/633345116df55e2d37be9be6555aa739656c5a7d/mfbt/HashFunctions.h#109-153)
7979
/// for a full description.
8080
const K: u64 = 0x517cc1b727220a95;
8181

src/util/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! [`array_chunks`] method.
33
//!
44
//! Using Rust's const generics, concrete implementations are provided for sizes 2 to 12 to handle
5-
//! the most common situations. Once [`array_chunks`] is stablized then this module can be removed.
5+
//! the most common situations. Once [`array_chunks`] is stabilized then this module can be removed.
66
//!
77
//! [`array_chunks`]: std::iter::Iterator::array_chunks
88
pub struct Chunk<I: Iterator, const N: usize> {

src/year2015/day13.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This problem is very similar to [`Day 9`] and we solve it in almost exactly the same way by
44
//! computing an adjacency matrix of happiness then permuting the order of the diners.
55
//!
6-
//! For part one we reduce the permutatations from 8! = 40,320 permutations to 7! = 5,040
6+
//! For part one we reduce the permutations from 8! = 40,320 permutations to 7! = 5,040
77
//! permutations by arbitrarily choosing one of the diners as the start.
88
//!
99
//! We solve part two at the same time by noticing that by inserting yourself between two diners

src/year2015/day18.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! 5. Apply the rules using only bitwise logic.
3636
//!
3737
//! Consider the binary representation of a 4 bit hex digit.
38-
//! * A cell stays on if it has 2 or 3 neigbours, binary `0010` or binary `0011`.
38+
//! * A cell stays on if it has 2 or 3 neighbors, binary `0010` or binary `0011`.
3939
//! * A cell turns on if it has exactly 3 neighbors, binary `0011`.
4040
//!
4141
//! If we `OR` the neighbor count with the current cell, either `0000` or `0001` then the

src/year2015/day24.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//!
66
//! Sorts the weights in ascending order, then tries combinations of increasing size until a
77
//! match in found. This will be the answer since the package count is the smallest and the
8-
//! quantum entaglement will also be the lowest.
8+
//! quantum entanglement will also be the lowest.
99
use crate::util::bitset::*;
1010
use crate::util::parse::*;
1111

src/year2015/day25.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! There are two parts to solving this problem.
44
//!
5-
//! The first is converting the row and column to an *zero based* index. Using the example of
5+
//! The first is converting the row and column to a *zero-based* index. Using the example of
66
//! the 12th code at row 4 column 2:
77
//!
88
//! ```none
@@ -23,11 +23,11 @@
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
2525
//! `5 * (5 + 1) / 2 = 15`. Then we count backward by `row` elements to get the one less
26-
//! zero based based index `15 - 4 = 11`.
26+
//! zero-based index `15 - 4 = 11`.
2727
//!
2828
//! The second part is realizing that the description of the code generation is
2929
//! [modular exponentiation](https://en.wikipedia.org/wiki/Modular_exponentiation). The exponent
30-
//! of the first code is zero, which is the reason for using a zero based index.
30+
//! of the first code is zero, which is the reason for using a zero-based index.
3131
use crate::util::iter::*;
3232
use crate::util::math::*;
3333
use crate::util::parse::*;

src/year2016/day16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! We find the number of ones for a pattern of length `n` in `log(n)` complexity as follows:
1414
//! * Start with a known pattern `abcde` and let the reversed bit inverse of this pattern be
1515
//! `EDCBA`.
16-
//! * Caculate the [prefix sum](https://en.wikipedia.org/wiki/Prefix_sum) of the known sequence.
16+
//! * Calculate the [prefix sum](https://en.wikipedia.org/wiki/Prefix_sum) of the known sequence.
1717
//! * If the requested length is within the known sequence (in this example from 0 to 5 inclusive)
1818
//! then we're done, return the number of ones directly.
1919
//! * Else after one repetition this becomes `abcde0EDCBA`.

src/year2016/day19.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//!
2525
//! ~~1~~ ~~2~~ 3 ~~4~~ 5
2626
//!
27-
//! We can represent this as a loop
27+
//! We can represent this as a loop:
2828
//!
2929
//! ```none
3030
//! let mut n = <starting number of elves>
@@ -67,12 +67,12 @@
6767
//!
6868
//! `a b` => `a b c`
6969
//!
70-
//! Play passes to the left, in this case elf `a` must have eliminated an elf 2 steps away
70+
//! Play passes to the left, in this case elf `a` must have eliminated an elf 2 steps away:
7171
//!
7272
//! `a b c` => `a b d c`
7373
//!
7474
//! Play passes to the left, wrapping around to elf `c` that must have eliminated an elf 2 steps
75-
//! away
75+
//! away:
7676
//!
7777
//! `a b d c` => `a e b d c`
7878
//!

src/year2017/day18.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
//! Each input differs only in the number specified on line 10.
55
//!
66
//! The first section is only executed by program 0 and generates a pseudorandom sequence of
7-
//! 127 numbers between 0 and 9999. The programs then take turns implementing the innner loop of
8-
//! the [imfamous bubble sort](https://en.wikipedia.org/wiki/Bubble_sort) in descending order.
7+
//! 127 numbers between 0 and 9999. The programs then take turns implementing the inner loop of
8+
//! the [infamous bubble sort](https://en.wikipedia.org/wiki/Bubble_sort) in descending order.
99
//!
1010
//! The partially sorted sequence is passed back and forth between each program until in final
11-
//! sorted order. Assembly code annotated with Rust pseduocode:
11+
//! sorted order. Assembly code annotated with Rust pseudocode:
1212
//!
1313
//! ```none
1414
//! set i 31

src/year2017/day25.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub fn part1(input: &Input) -> i32 {
9696
remaining -= steps;
9797
checksum += ones;
9898

99-
// Use a vector to simulate an empty tape. In practise the cursor doesn't move more than
99+
// Use a vector to simulate an empty tape. In practice the cursor doesn't move more than
100100
// a few thousand steps in any direction, so this approach is as fast as a fixed size
101101
// array, but much more robust.
102102
if advance {

0 commit comments

Comments
 (0)