20 lines
291 B
Rust
20 lines
291 B
Rust
use serde_derive::Serialize;
|
|
|
|
#[derive(Serialize)]
|
|
pub struct UserType<T>(T);
|
|
|
|
#[derive(Serialize)]
|
|
pub struct Test<'a> {
|
|
foo: &'a str,
|
|
bar: UserType<&'a str>
|
|
}
|
|
|
|
fn main() {
|
|
let val = Test {
|
|
foo: "hello",
|
|
bar: UserType("world")
|
|
};
|
|
|
|
println!("{}", sehn::to_string(&val).unwrap());
|
|
}
|