Debian Codegraph @

tests/compile_derives/schema/test_generic_enums.rs

raw
1 #![allow(unused)]
2 use crate::common_macro::schema_imports::*;
3
4 use core::fmt::{Debug, Display};
5
6 /// test: Sausage wasn't populated with param Sausage<W>
7 #[derive(borsh::BorshSchema, Debug)]
8 enum AWithSkip<C, W> {
9 Bacon,
10 Eggs,
11 Salad(u32, C, u32),
12 Sausage {
13 #[borsh(skip)]
14 wrapper: W,
15 filling: u32,
16 },
17 }
18
19 /// test: inner structs in BorshSchema derive don't need any bounds, unrelated to BorshSchema
20 // #[derive(borsh::BorshSchema)]
21 // struct SideLeft<A>(
22 // A,
23 // )
24 // where
25 // A: Display + Debug,
26 // B: Display + Debug;
27 #[derive(borsh::BorshSchema)]
28 enum Side<A, B>
29 where
30 A: Display + Debug,
31 B: Display + Debug,
32 {
33 Left(A),
34 Right(B),
35 }