Hi, any plan to implement Serialize and Deserialize for ManuallyDrop?
I happen to bump into a case when I need the compiler to not automatically drop on a certain function.
#[derive(Default, Serialize, Deserialize)]
pub struct Machine<'a> {
#[serde(flatten)]
schema: StateChart, // it should be 👇
// schema: mem::ManuallyDrop<StateChart>,
#[serde(skip)]
builder: Scdlang<'a>,
}
impl<'a> Parser<'a> for Machine<'a> {
fn parse(&mut self, source: &str) -> Result<(), DynError> {
let ast = Self::try_parse(source, self.builder.to_owned())?;
self.schema.states = ast.schema.states.to_owned(); //âš expensive clone
// self.schema.states = ast.schema.states; //👈 with ManuallyDrop
Ok(()
}
}
impl Drop for Machine<'_> {
fn drop(&mut self) {
self.clear_cache().expect("Deadlock");
}
}
Hi, any plan to implement Serialize and Deserialize for ManuallyDrop? I happen to bump into a case when I need the compiler to not automatically drop on a certain function.