Skip to content

Commit d775511

Browse files
committed
test: add another test with various field combinations
This tests build for various combinations of different types, in particular some involving cloned types in containers like Vec and Option.
1 parent 65ec3a5 commit d775511

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/many_fields.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#[macro_use]
2+
extern crate derive_into_owned;
3+
4+
use std::borrow::Cow;
5+
6+
#[allow(dead_code, clippy::redundant_allocation)]
7+
#[derive(IntoOwned, Borrowed)]
8+
struct TestTypes<'a> {
9+
a: Box<Cow<'a, str>>,
10+
b: Box<i32>,
11+
c: Option<i32>,
12+
d: Vec<i32>,
13+
e: Option<Box<i32>>,
14+
f: Option<Box<Box<i32>>>,
15+
g: Box<Option<()>>,
16+
h: String,
17+
i: (String, String),
18+
j: (),
19+
k: Option<(i32, String)>,
20+
l: Option<(i32, Vec<String>, Cow<'a, str>)>,
21+
m: Box<(i32, String, Vec<Cow<'a, str>>)>,
22+
n: Vec<(i32, Option<String>, Option<Cow<'a, str>>)>,
23+
o: ((), ()),
24+
p: (String, (String, (String, String))),
25+
#[allow(clippy::type_complexity)]
26+
q: (String, (String, (String, Box<Cow<'a, str>>))),
27+
}

0 commit comments

Comments
 (0)