From 7544a6b71e6d81878a84583298c9be75b4d4e275 Mon Sep 17 00:00:00 2001 From: Baelyk Date: Sun, 18 Mar 2018 10:35:53 -0500 Subject: [PATCH 1/2] Remove variables that start with an underscore Resolves #476 Removed the underscore and included the variable in the `unimplemented!()` macro to get around unused variable warnings. --- exercises/diffie-hellman/src/lib.rs | 14 +++++++------- exercises/isbn-verifier/src/lib.rs | 6 +++--- exercises/series/src/lib.rs | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/exercises/diffie-hellman/src/lib.rs b/exercises/diffie-hellman/src/lib.rs index e95ee54f1..709b205be 100644 --- a/exercises/diffie-hellman/src/lib.rs +++ b/exercises/diffie-hellman/src/lib.rs @@ -1,11 +1,11 @@ -pub fn private_key(_p: u64) -> u64 { - unimplemented!() +pub fn private_key(p: u64) -> u64 { + unimplemented!("Pick a private key greater than and less than {}", p) } -pub fn public_key(_p: u64, _g: u64, _a: u64) -> u64 { - unimplemented!() +pub fn public_key(p: u64, g: u64, a: u64) -> u64 { + unimplemented!("Calculate public key using prime numbers {} and {}, and private key {}", p, g, a) } -pub fn secret(_p: u64, _b_pub: u64, _a: u64) -> u64 { - unimplemented!() -} +pub fn secret(p: u64, b_pub: u64, a: u64) -> u64 { + unimplemented!("Calculate secret key using prime number {}, public key {}, and private key {}", p, b_pub, a) +} \ No newline at end of file diff --git a/exercises/isbn-verifier/src/lib.rs b/exercises/isbn-verifier/src/lib.rs index b2b0ad73b..bd37674bd 100644 --- a/exercises/isbn-verifier/src/lib.rs +++ b/exercises/isbn-verifier/src/lib.rs @@ -1,4 +1,4 @@ /// Determines whether the supplied string is a valid ISBN number -pub fn is_valid_isbn(_isbn: &str) -> bool { - unimplemented!(); -} +pub fn is_valid_isbn(isbn: &str) -> bool { + unimplemented!("Is {:?} a valid ISBN number?", isbn); +} \ No newline at end of file diff --git a/exercises/series/src/lib.rs b/exercises/series/src/lib.rs index 58427946d..1c4cbaba2 100644 --- a/exercises/series/src/lib.rs +++ b/exercises/series/src/lib.rs @@ -1,3 +1,3 @@ -pub fn series(_digits: &str, _len: usize) -> Vec { - unimplemented!() -} +pub fn series(digits: &str, len: usize) -> Vec { + unimplemented!("What are the series of length {} in string {:?}", len, digits) +} \ No newline at end of file From fafa94cc6bbe6a1fb95bcd36c9b3ae2c17f6658d Mon Sep 17 00:00:00 2001 From: Baelyk Date: Mon, 19 Mar 2018 09:31:21 -0500 Subject: [PATCH 2/2] Fix newlines and typo Added new lines in all three, and fixed a typo in diffie-hellman. --- exercises/diffie-hellman/src/lib.rs | 4 ++-- exercises/isbn-verifier/src/lib.rs | 2 +- exercises/series/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/diffie-hellman/src/lib.rs b/exercises/diffie-hellman/src/lib.rs index 709b205be..dfda317b8 100644 --- a/exercises/diffie-hellman/src/lib.rs +++ b/exercises/diffie-hellman/src/lib.rs @@ -1,5 +1,5 @@ pub fn private_key(p: u64) -> u64 { - unimplemented!("Pick a private key greater than and less than {}", p) + unimplemented!("Pick a private key greater than 1 and less than {}", p) } pub fn public_key(p: u64, g: u64, a: u64) -> u64 { @@ -8,4 +8,4 @@ pub fn public_key(p: u64, g: u64, a: u64) -> u64 { pub fn secret(p: u64, b_pub: u64, a: u64) -> u64 { unimplemented!("Calculate secret key using prime number {}, public key {}, and private key {}", p, b_pub, a) -} \ No newline at end of file +} diff --git a/exercises/isbn-verifier/src/lib.rs b/exercises/isbn-verifier/src/lib.rs index bd37674bd..f2f95029b 100644 --- a/exercises/isbn-verifier/src/lib.rs +++ b/exercises/isbn-verifier/src/lib.rs @@ -1,4 +1,4 @@ /// Determines whether the supplied string is a valid ISBN number pub fn is_valid_isbn(isbn: &str) -> bool { unimplemented!("Is {:?} a valid ISBN number?", isbn); -} \ No newline at end of file +} diff --git a/exercises/series/src/lib.rs b/exercises/series/src/lib.rs index 1c4cbaba2..8e2d7e690 100644 --- a/exercises/series/src/lib.rs +++ b/exercises/series/src/lib.rs @@ -1,3 +1,3 @@ pub fn series(digits: &str, len: usize) -> Vec { unimplemented!("What are the series of length {} in string {:?}", len, digits) -} \ No newline at end of file +}