mirror of
https://github.com/ricoriedel/wipe.git
synced 2024-11-26 01:46:36 +00:00
Remove name function
This commit is contained in:
parent
dcbae98ed3
commit
32cd72552e
@ -9,10 +9,6 @@ pub struct Circle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PatternFactory for CircleFactory {
|
impl PatternFactory for CircleFactory {
|
||||||
fn name(&self) -> String {
|
|
||||||
stringify!(Circle).to_lowercase()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
||||||
Box::new(Circle::new(config))
|
Box::new(Circle::new(config))
|
||||||
}
|
}
|
||||||
@ -38,11 +34,6 @@ mod test {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use approx::*;
|
use approx::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn name() {
|
|
||||||
assert_eq!("circle", CircleFactory::default().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sample() {
|
fn sample() {
|
||||||
let config = Config {
|
let config = Config {
|
||||||
|
@ -8,10 +8,6 @@ pub struct Line {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PatternFactory for LineFactory {
|
impl PatternFactory for LineFactory {
|
||||||
fn name(&self) -> String {
|
|
||||||
stringify!(Line).to_lowercase()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
||||||
Box::new(Line::new(config))
|
Box::new(Line::new(config))
|
||||||
}
|
}
|
||||||
@ -36,11 +32,6 @@ mod test {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use approx::*;
|
use approx::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn name() {
|
|
||||||
assert_eq!("line", LineFactory::default().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sample() {
|
fn sample() {
|
||||||
let config = Config {
|
let config = Config {
|
||||||
|
@ -17,8 +17,6 @@ pub struct Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait PatternFactory {
|
pub trait PatternFactory {
|
||||||
fn name(&self) -> String;
|
|
||||||
|
|
||||||
fn create(&self, config: &Config) -> Box<dyn Pattern>;
|
fn create(&self, config: &Config) -> Box<dyn Pattern>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,6 @@ pub struct Rhombus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PatternFactory for RhombusFactory {
|
impl PatternFactory for RhombusFactory {
|
||||||
fn name(&self) -> String {
|
|
||||||
stringify!(Rhombus).to_lowercase()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
||||||
Box::new(Rhombus::new(config))
|
Box::new(Rhombus::new(config))
|
||||||
}
|
}
|
||||||
@ -38,11 +34,6 @@ mod test {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use approx::*;
|
use approx::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn name() {
|
|
||||||
assert_eq!("rhombus", RhombusFactory::default().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sample() {
|
fn sample() {
|
||||||
let config = Config {
|
let config = Config {
|
||||||
|
@ -9,10 +9,6 @@ pub struct Wheel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PatternFactory for WheelFactory {
|
impl PatternFactory for WheelFactory {
|
||||||
fn name(&self) -> String {
|
|
||||||
stringify!(Wheel).to_lowercase()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
fn create(&self, config: &Config) -> Box<dyn Pattern> {
|
||||||
Box::new(Wheel::new(config))
|
Box::new(Wheel::new(config))
|
||||||
}
|
}
|
||||||
@ -37,11 +33,6 @@ mod test {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use approx::*;
|
use approx::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn name() {
|
|
||||||
assert_eq!("wheel", WheelFactory::default().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sample() {
|
fn sample() {
|
||||||
let config = Config {
|
let config = Config {
|
||||||
|
Loading…
Reference in New Issue
Block a user