We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 131e805 commit 82926bcCopy full SHA for 82926bc
tests/derive_delegate.rs
@@ -0,0 +1,26 @@
1
+#[portrait::make]
2
+trait Foo {
3
+ fn new(arg1: i32, arg2: &str, arg3: &mut i64) -> Self;
4
+ fn print(&self);
5
+ fn clone(&self) -> Self;
6
+ #[portrait(derive_delegate(reduce = |a, b| a && b))]
7
+ fn eq(&self, other: &Self) -> bool;
8
+}
9
+
10
+#[portrait::fill(portrait::default)]
11
+impl Foo for i32 { }
12
13
14
+impl Foo for String {}
15
16
+#[portrait::derive(Foo with portrait::derive_delegate)]
17
+struct Fields {
18
+ a: i32,
19
+ b: String,
20
21
22
+fn main() {
23
+ fn assert(_: impl Foo) {}
24
25
+ assert(Fields { a: 1, b: String::new() });
26
0 commit comments