Skip to content

Commit

Permalink
test: add another test with various field combinations
Browse files Browse the repository at this point in the history
This tests build for various combinations of different types, in
particular some involving cloned types in containers like Vec and
Option.
  • Loading branch information
neocturne committed May 7, 2024
1 parent 65ec3a5 commit d775511
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/many_fields.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#[macro_use]
extern crate derive_into_owned;

use std::borrow::Cow;

#[allow(dead_code, clippy::redundant_allocation)]
#[derive(IntoOwned, Borrowed)]
struct TestTypes<'a> {
a: Box<Cow<'a, str>>,
b: Box<i32>,
c: Option<i32>,
d: Vec<i32>,
e: Option<Box<i32>>,
f: Option<Box<Box<i32>>>,
g: Box<Option<()>>,
h: String,
i: (String, String),
j: (),
k: Option<(i32, String)>,
l: Option<(i32, Vec<String>, Cow<'a, str>)>,
m: Box<(i32, String, Vec<Cow<'a, str>>)>,
n: Vec<(i32, Option<String>, Option<Cow<'a, str>>)>,
o: ((), ()),
p: (String, (String, (String, String))),
#[allow(clippy::type_complexity)]
q: (String, (String, (String, Box<Cow<'a, str>>))),
}

0 comments on commit d775511

Please sign in to comment.