From b6a2ae85f483e5b2df212681955a990683d4d79b Mon Sep 17 00:00:00 2001 From: Nicolas <> Date: Wed, 13 Apr 2022 19:41:59 +0200 Subject: [PATCH] Rename trait --- src/choose.rs | 8 ++++---- src/main.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/choose.rs b/src/choose.rs index 7f01b52..fa82d7c 100644 --- a/src/choose.rs +++ b/src/choose.rs @@ -1,7 +1,7 @@ use rand::prelude::IteratorRandom; use rand::Rng; -pub trait Options { +pub trait Collection { fn all() -> Vec where Self: Sized; } @@ -14,7 +14,7 @@ impl Chooser { Self { rng } } - pub fn choose(&mut self, selection: Vec) -> TValue { + pub fn choose(&mut self, selection: Vec) -> TValue { let options = if selection.is_empty() { TValue::all() } else { @@ -27,7 +27,7 @@ impl Chooser { #[cfg(test)] mod test { use rand::rngs::mock::StepRng; - use crate::{Chooser, Options}; + use crate::{Chooser, Collection}; enum MockOptions { First, @@ -35,7 +35,7 @@ mod test { Third } - impl Options for MockOptions { + impl Collection for MockOptions { fn all() -> Vec where Self: Sized { use MockOptions::*; diff --git a/src/main.rs b/src/main.rs index bff1f2a..cd5c6d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use crate::animation::circle::CircleAnimation; use crate::animation::rhombus::RhombusAnimation; use crate::animation::rotation::RotationAnimation; use crate::char::SimpleCharSampler; -use crate::choose::{Chooser, Options}; +use crate::choose::{Chooser, Collection}; use crate::color::{ColorSampler, SimpleColorSampler}; use crate::fill::circle::CircleFillMode; use crate::fill::FillMode; @@ -41,7 +41,7 @@ macro_rules! options { enum $name { $($opt,)* } - impl Options for $name { + impl Collection for $name { fn all() -> Vec { vec![$($name::$opt,)*] }