From 6e448cc99cf3dfdf606eb4af9fd14e3e7f1e49f0 Mon Sep 17 00:00:00 2001 From: ZapAnton Date: Wed, 8 Aug 2018 12:21:18 +0300 Subject: [PATCH 1/3] sublist: Added template to the stub file --- exercises/sublist/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/exercises/sublist/src/lib.rs b/exercises/sublist/src/lib.rs index 8b1378917..b4649f7da 100644 --- a/exercises/sublist/src/lib.rs +++ b/exercises/sublist/src/lib.rs @@ -1 +1,13 @@ +use std::fmt::Debug; +#[derive(Debug, PartialEq)] +pub enum Comparison { + Equal, + Sublist, + Superlist, + Unequal, +} + +pub fn sublist(first_list: &[T], second_list: &[T]) -> Comparison { + unimplemented!("Determine if the first list '{:?}' is equal to, sublist of, superlist of or unequal to the second list '{:?}'", first_list, second_list); +} From 91d17430cfb353dde25e7523536991d92e679a00 Mon Sep 17 00:00:00 2001 From: ZapAnton Date: Mon, 20 Aug 2018 09:46:48 +0300 Subject: [PATCH 2/3] sublist: Removed the Debug trait bound from the stub file template --- exercises/sublist/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exercises/sublist/src/lib.rs b/exercises/sublist/src/lib.rs index b4649f7da..380f01c19 100644 --- a/exercises/sublist/src/lib.rs +++ b/exercises/sublist/src/lib.rs @@ -1,5 +1,3 @@ -use std::fmt::Debug; - #[derive(Debug, PartialEq)] pub enum Comparison { Equal, @@ -8,6 +6,6 @@ pub enum Comparison { Unequal, } -pub fn sublist(first_list: &[T], second_list: &[T]) -> Comparison { - unimplemented!("Determine if the first list '{:?}' is equal to, sublist of, superlist of or unequal to the second list '{:?}'", first_list, second_list); +pub fn sublist(_first_list: &[T], _second_list: &[T]) -> Comparison { + unimplemented!("Determine if the first list is equal to, sublist of, superlist of or unequal to the second list."); } From 99e15ae680580a19e0f5ca12d0fa610d4916701d Mon Sep 17 00:00:00 2001 From: ZapAnton Date: Mon, 27 Aug 2018 11:28:40 +0300 Subject: [PATCH 3/3] sublist: Added PartialEq trait bound in the stub file template --- exercises/sublist/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/sublist/src/lib.rs b/exercises/sublist/src/lib.rs index 380f01c19..b41f4375d 100644 --- a/exercises/sublist/src/lib.rs +++ b/exercises/sublist/src/lib.rs @@ -6,6 +6,6 @@ pub enum Comparison { Unequal, } -pub fn sublist(_first_list: &[T], _second_list: &[T]) -> Comparison { +pub fn sublist(_first_list: &[T], _second_list: &[T]) -> Comparison { unimplemented!("Determine if the first list is equal to, sublist of, superlist of or unequal to the second list."); }