Skip to content

Commit b3b23f6

Browse files
BaelykIanWhitney
authored andcommitted
Swaps all _ only parameters for input (#474)
* Swaps all `_` only parameters for `input` Resolves #442 Changed the parameter to `input`, and uses it in `unimplemented!()` to silence the unused variable warning. Meaningful filler for the unimplemented!() macros Stopped using just `input` where something else made more sense.
1 parent aee3d5d commit b3b23f6

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

exercises/alphametics/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::HashMap;
22

3-
pub fn solve(_: &str) -> Option<HashMap<char, u8>> {
4-
unimplemented!()
3+
pub fn solve(input: &str) -> Option<HashMap<char, u8>> {
4+
unimplemented!("Solve the alphametic {:?}", input)
55
}

exercises/book-store/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pub fn lowest_price(_: &[usize]) -> usize {
2-
unimplemented!()
1+
pub fn lowest_price(books: &[usize]) -> usize {
2+
unimplemented!("Find the lowest price of the bookbasket with books {:?}", books)
33
}

exercises/crypto-square/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pub fn encrypt(_: &str) -> String {
2-
unimplemented!()
1+
pub fn encrypt(input: &str) -> String {
2+
unimplemented!("Encrypt {:?} using a square code", input)
33
}

exercises/decimal/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub struct Decimal {
44
}
55

66
impl Decimal {
7-
pub fn try_from(_: &str) -> Option<Decimal> {
8-
unimplemented!()
7+
pub fn try_from(input: &str) -> Option<Decimal> {
8+
unimplemented!("Create a new decimal with a value of {}", input)
99
}
1010
}

exercises/poker/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
///
33
/// Note the type signature: this function should return _the same_ reference to
44
/// the winning hand(s) as were passed in, not reconstructed strings which happen to be equal.
5-
pub fn winning_hands<'a>(_: &[&'a str]) -> Option<Vec<&'a str>> {
6-
unimplemented!()
5+
pub fn winning_hands<'a>(hands: &[&'a str]) -> Option<Vec<&'a str>> {
6+
unimplemented!("Out of {:?}, which hand wins?", hands)
77
}

0 commit comments

Comments
 (0)