Skip to content

Commit 4de5f33

Browse files
committed
Tidy comments
1 parent 72d04c1 commit 4de5f33

File tree

9 files changed

+14
-15
lines changed

9 files changed

+14
-15
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ They're pretty fast and clean...but can you make them even *faster and cleaner*?
55

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

10-
11-
It should generally fall into one of the following two categories:
10+
Your contribution should generally fall into one of the following two categories:
1211

1312
* 🪲 **Bug Fix** Solutions try to be as general as possible but can't test for every input.
1413
Your pull request fixes an incorrect answer for your input or prevents a panic.
@@ -27,13 +26,13 @@ may be provided under the project license.
2726
Pull requests should meet the following baseline standards:
2827

2928
* Commit messages and pull request title are clear and informative.
30-
* Code style matches the existing code. This one is somewhat subjective but try to "fit in" by
29+
* Code style matches the existing code. This one is somewhat subjective, but try to "fit in" by
3130
using the same naming conventions. Code should be portable, avoiding any architecture
3231
specific intrinsics.
3332
* Unit tests pass.
3433
* Code is formatted using `rustfmt`.
3534
* Code is linted using `clippy`.
3635

3736
Formatting and linting can be executed by running [`just`](https://github.com/casey/just)
38-
(if installed) on the command line at the project root, or alternatively copying and pasting
37+
(if installed) on the command line at the project root, or by copying and pasting
3938
the commands from [`justfile`](justfile) into the terminal.

src/year2018/day06.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn part1(input: &Input) -> i32 {
7373
let width = x1 - x0;
7474

7575
if delta < -width {
76-
// Left coordinate is further away at every points.
76+
// Left coordinate is further away at every point.
7777
// Discard and pop next left coordinate from the stack.
7878
//
7979
// rrrrrrrrrrrrrrrr <-- Considering only this row

src/year2021/day11.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn simulate(input: &Input, predicate: fn(usize, usize) -> bool) -> (usize, usize
4545
while predicate(flashes, steps) {
4646
flashes = 0;
4747

48-
// Bump each octopus' energy level by one. If it flashes then add to `todo` queue.
48+
// Bump each octopus's energy level by one. If it flashes then add to `todo` queue.
4949
for y in 0..10 {
5050
for x in 0..10 {
5151
let index = 12 * (y + 1) + (x + 1);

src/year2023/day03.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn parse(input: &str) -> Input {
4444
Input { grid, seen, parts }
4545
}
4646

47-
/// Sum all part numbers adjacent to a least one symbol.
47+
/// Sum all part numbers adjacent to at least one symbol.
4848
pub fn part1(input: &Input) -> u32 {
4949
let Input { grid, seen, parts } = input;
5050
let mut parts = parts.clone();
@@ -60,7 +60,7 @@ pub fn part1(input: &Input) -> u32 {
6060
let index = seen[p + d];
6161
if index != 0 {
6262
result += parts[index];
63-
// Only count each number once when its adjacent to multiple symbols.
63+
// Only count each number once when it is adjacent to multiple symbols.
6464
parts[index] = 0;
6565
}
6666
}

src/year2024/day04.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! same time.
66
//!
77
//! For part two the difference of the ASCII values of "M" and "S" is 6. No other combination of
8-
//! letter has this value, so if both diagonals are a 6 then we have a match.
8+
//! letters has this value, so if both diagonals are a 6 then we have a match.
99
use crate::util::grid::*;
1010
use crate::util::point::*;
1111

src/year2024/day06.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn is_cycle(
102102
return true;
103103
}
104104

105-
// The tricky part is checking for the new time travelling instigated obstacle.
105+
// The tricky part is checking for the newly introduced time-traveling obstacle.
106106
position = match direction {
107107
UP => {
108108
let next = shortcut.up[position];

src/year2024/day08.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! # Resonant Collinearity
22
//!
3-
//! Antennas frequencies are grouped together to reduce the O(n²) pairwise comparisons.
3+
//! Antenna frequencies are grouped together to reduce the O(n²) pairwise comparisons.
44
use crate::util::grid::*;
55
use crate::util::hash::*;
66
use crate::util::point::*;

src/year2024/day12.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//! region or out of bounds.
77
//!
88
//! For part two we count each plot on the edge as either 0, 1 or 2 sides then divide by 2.
9-
//! An edge plot contributes nothing if it has 2 edge neighbours facing the same way,
10-
//! one if has a single neighbour and two if it has no neighbours.
9+
//! An edge plot contributes nothing if it has 2 edge neighbors facing the same way,
10+
//! one if it has a single neighbor and two if it has no neighbors.
1111
//!
1212
//! For example, considering the right edge:
1313
//!

src/year2024/day15.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn wide(grid: &mut Grid<u8>, start: &mut Point, direction: Point, todo: &mut Vec
115115

116116
// Clear any items from previous push.
117117
todo.clear();
118-
// Add dummy item to prevent index of out bounds when checking for previously added boxes.
118+
// Add dummy item to prevent index out of bounds when checking for previously added boxes.
119119
todo.push(ORIGIN);
120120
todo.push(*start);
121121
let mut index = 1;

0 commit comments

Comments
 (0)