Skip to content

Commit

Permalink
add better example
Browse files Browse the repository at this point in the history
  • Loading branch information
bsh98 committed Jan 7, 2024
1 parent 5f5cb14 commit 2d8fe98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions trait-variant/examples/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -37,9 +37,10 @@ where
const CONST: usize = 3;
type F;
type A<const ANOTHER_CONST: u8>;
type B<T>: Add<T>;
type B<T: Display>: FromIterator<T>;

async fn take(&self, s: S);
fn build<T: Display>(&self, items: impl Iterator<Item = T>) -> Self::B<T>;
}

fn main() {}

0 comments on commit 2d8fe98

Please sign in to comment.