From 32cd72552ed935625f568e6fca5a56531aac141c Mon Sep 17 00:00:00 2001 From: Rico Riedel Date: Wed, 3 Aug 2022 17:34:40 +0200 Subject: [PATCH] Remove name function --- src/pattern/circle.rs | 9 --------- src/pattern/line.rs | 9 --------- src/pattern/mod.rs | 2 -- src/pattern/rhombus.rs | 9 --------- src/pattern/wheel.rs | 9 --------- 5 files changed, 38 deletions(-) diff --git a/src/pattern/circle.rs b/src/pattern/circle.rs index c6b2a89..c5abcbb 100644 --- a/src/pattern/circle.rs +++ b/src/pattern/circle.rs @@ -9,10 +9,6 @@ pub struct Circle { } impl PatternFactory for CircleFactory { - fn name(&self) -> String { - stringify!(Circle).to_lowercase() - } - fn create(&self, config: &Config) -> Box { Box::new(Circle::new(config)) } @@ -38,11 +34,6 @@ mod test { use super::*; use approx::*; - #[test] - fn name() { - assert_eq!("circle", CircleFactory::default().name()); - } - #[test] fn sample() { let config = Config { diff --git a/src/pattern/line.rs b/src/pattern/line.rs index 281df04..409faeb 100644 --- a/src/pattern/line.rs +++ b/src/pattern/line.rs @@ -8,10 +8,6 @@ pub struct Line { } impl PatternFactory for LineFactory { - fn name(&self) -> String { - stringify!(Line).to_lowercase() - } - fn create(&self, config: &Config) -> Box { Box::new(Line::new(config)) } @@ -36,11 +32,6 @@ mod test { use super::*; use approx::*; - #[test] - fn name() { - assert_eq!("line", LineFactory::default().name()); - } - #[test] fn sample() { let config = Config { diff --git a/src/pattern/mod.rs b/src/pattern/mod.rs index 350aeae..764a047 100644 --- a/src/pattern/mod.rs +++ b/src/pattern/mod.rs @@ -17,8 +17,6 @@ pub struct Config { } pub trait PatternFactory { - fn name(&self) -> String; - fn create(&self, config: &Config) -> Box; } diff --git a/src/pattern/rhombus.rs b/src/pattern/rhombus.rs index 69249e6..aaa019e 100644 --- a/src/pattern/rhombus.rs +++ b/src/pattern/rhombus.rs @@ -9,10 +9,6 @@ pub struct Rhombus { } impl PatternFactory for RhombusFactory { - fn name(&self) -> String { - stringify!(Rhombus).to_lowercase() - } - fn create(&self, config: &Config) -> Box { Box::new(Rhombus::new(config)) } @@ -38,11 +34,6 @@ mod test { use super::*; use approx::*; - #[test] - fn name() { - assert_eq!("rhombus", RhombusFactory::default().name()); - } - #[test] fn sample() { let config = Config { diff --git a/src/pattern/wheel.rs b/src/pattern/wheel.rs index cd40fc7..b205276 100644 --- a/src/pattern/wheel.rs +++ b/src/pattern/wheel.rs @@ -9,10 +9,6 @@ pub struct Wheel { } impl PatternFactory for WheelFactory { - fn name(&self) -> String { - stringify!(Wheel).to_lowercase() - } - fn create(&self, config: &Config) -> Box { Box::new(Wheel::new(config)) } @@ -37,11 +33,6 @@ mod test { use super::*; use approx::*; - #[test] - fn name() { - assert_eq!("wheel", WheelFactory::default().name()); - } - #[test] fn sample() { let config = Config {