mirror of
https://git.proxmox.com/git/perlmod
synced 2025-10-04 16:50:06 +00:00
perlmod: add missing drop handler for RawGuard
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
1624184105
commit
3b56a68df4
@ -15,6 +15,12 @@ thread_local!(static SERIALIZE_RAW: RefCell<bool> = RefCell::new(false));
|
||||
|
||||
pub(crate) struct RawGuard(bool);
|
||||
|
||||
impl Drop for RawGuard {
|
||||
fn drop(&mut self) {
|
||||
SERIALIZE_RAW.with(|raw| *raw.borrow_mut() = self.0);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn guarded(on: bool) -> RawGuard {
|
||||
SERIALIZE_RAW.with(move |raw| RawGuard(raw.replace(on)))
|
||||
|
Loading…
Reference in New Issue
Block a user