perlmod/perlmod-test/src/option.rs
Wolfgang Bumiller 76f6a079eb clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-09 11:24:34 +01:00

20 lines
482 B
Rust

#[perlmod::package(name = "RSPM::Option", lib = "perlmod_test", write = true)]
mod export {
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
pub struct WithOption {
tristate: Option<bool>,
}
#[export]
pub fn to_string(tristate: Option<bool>) -> String {
format!("{tristate:?}")
}
#[export]
pub fn struct_to_string(with_option: WithOption) -> String {
format!("{:?}", with_option.tristate)
}
}