aboutsummaryrefslogtreecommitdiffstats
path: root/src/day2.rs
diff options
context:
space:
mode:
authorGravatar alecdwm 2018-12-10 13:25:18 +1000
committerGravatar alecdwm 2018-12-10 13:34:37 +1000
commitb9fc3ccc15c988a40b4c762c61e4277cd4f020b0 (patch)
treef9b2ee25e9fa6d7e7659a31acfe65e08e17a0828 /src/day2.rs
parent03c69dbe7d0fadf226bea5cf0d7eb28a93156716 (diff)
fixed clippy suggestions
Diffstat (limited to 'src/day2.rs')
-rw-r--r--src/day2.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/day2.rs b/src/day2.rs
index da2bb89..6f92604 100644
--- a/src/day2.rs
+++ b/src/day2.rs
@@ -42,7 +42,7 @@ pub fn part1() {
let mut seen_two = false;
let mut seen_three = false;
- for (_, count) in &seen_letter_counts {
+ for count in seen_letter_counts.values() {
if !seen_two && *count == 2 {
seen_two = true;
two_letter_checksum_component += 1;
@@ -82,7 +82,7 @@ pub fn part1() {
pub fn part2() {
let input = crate::common::read_stdin_to_string();
- let matches = find_part2_matches(input).expect("No matches found");
+ let matches = find_part2_matches(&input).expect("No matches found");
let common_letters: String = matches
.0
@@ -98,7 +98,7 @@ pub fn part2() {
);
}
-fn find_part2_matches(input: String) -> Option<(String, String)> {
+fn find_part2_matches(input: &str) -> Option<(String, String)> {
for box_id_1 in input.lines() {
'test_inner: for box_id_2 in input.lines() {
if box_id_1 == box_id_2 {