Remove name function

This commit is contained in:
Rico Riedel 2022-08-03 17:34:40 +02:00
parent dcbae98ed3
commit 32cd72552e
No known key found for this signature in database
GPG Key ID: 75AC868575DE7B18
5 changed files with 0 additions and 38 deletions

View File

@ -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<dyn Pattern> {
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 {

View File

@ -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<dyn Pattern> {
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 {

View File

@ -17,8 +17,6 @@ pub struct Config {
}
pub trait PatternFactory {
fn name(&self) -> String;
fn create(&self, config: &Config) -> Box<dyn Pattern>;
}

View File

@ -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<dyn Pattern> {
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 {

View File

@ -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<dyn Pattern> {
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 {