From 2d8fe98a0177f5db0397cfb39de3536274e30169 Mon Sep 17 00:00:00 2001 From: bsh98 Date: Sun, 7 Jan 2024 10:16:41 -0800 Subject: [PATCH] add better example --- trait-variant/examples/variant.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trait-variant/examples/variant.rs b/trait-variant/examples/variant.rs index f175bb7..04bcc6a 100644 --- a/trait-variant/examples/variant.rs +++ b/trait-variant/examples/variant.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{future::Future, ops::Add}; +use std::{fmt::Display, future::Future}; #[trait_variant::make(IntFactory: Send)] pub trait LocalIntFactory { @@ -37,9 +37,10 @@ where const CONST: usize = 3; type F; type A; - type B: Add; + type B: FromIterator; async fn take(&self, s: S); + fn build(&self, items: impl Iterator) -> Self::B; } fn main() {}