20 lines
297 B
Rust
20 lines
297 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_serde::to_string(&val).unwrap());
|
|
}
|