From a421309e6923b2f16bc788f423758d59584445fd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 3 Apr 2024 14:33:25 +0100 Subject: [PATCH] wip --- src/main.rs | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/main.rs b/src/main.rs index bef15e6..c1ab913 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,31 +1,19 @@ -#![allow(unused_imports)] -#![allow(unreachable_pub)] -#![allow(private_bounds)] -#![allow(unused_variables)] - -use educe::Educe; -use std::fmt::{self, Debug}; -use std::sync::Arc; - -trait Object {} - -impl Object for NotDebug {} - -#[derive(Educe)] -#[educe(Clone(bound(T: Clone)), Debug(bound(T: Debug)))] -//#[educe(Clone, Debug)] -pub struct Obj { - #[educe(Debug(ignore))] - data: Arc, +#[derive(strum::EnumIter)] +enum E { + Orange, + Lemon, + Apple, } -#[derive(Clone)] -struct NotDebug; +impl E { + fn is_citrus(&self) -> bool { + match self { + E::Orange | E::Lemon => true, + E::Apple => false, + } + } +} -fn main() { - let a = Obj { - data: Arc::new(NotDebug), - }; - let a = Clone::clone(&a); -// println!("{:?}", &a); +pub fn all_citrus() { + E::iter().all(|e| e.is_citrus()) } -- 2.30.2