Skip to content

Version 0.3.0

Choose a tag to compare

@MaxMahem MaxMahem released this 12 Jan 00:26
· 2 commits to main since this release
d0b7dbe

Changed

  • Breaking - Renamed new() to guard() for empty guard constructors:
    • NoDropEmpty::new() → NoDropEmpty::guard()
    • NoDropNoOpEmpty::new() → NoDropNoOpEmpty::guard()
  • Breaking - Renamed marker types and traits:
    • PassMarker trait renamed to MsgMarker
    • Empty marker type renamed to NoMsg
  • Breaking - Replaced DEFAULT_DROP_PANIC_MSG module constant with type-associated constants
    • Removed public DEFAULT_DROP_PANIC_MSG export from dbg and rls modules
    • Added PANIC_MSG as a public associated constant on Empty variant types:
      • NoDrop::PANIC_MSG
      • DropGuardEmpty::PANIC_MSG
    • Added PANIC_MSG as a public associated constant on Message variant types:
      • NoDropMsg::PANIC_MSG
      • DropGuardMsg::PANIC_MSG
  • Specified MSRV as 1.85.1
  • Made the following methods const:
    • DropGuardEmpty: guard(), wrap(), armed(), disarmed()
    • DropGuardMsg: guard(), wrap(), armed(), disarmed()
    • DropGuardPass: guard(), wrap(), armed(), disarmed()

Fixed

  • Fixed DropGuardMsg::disarm() where calling disarm() on an already-disarmed guard would lose the panic message. The message is now properly preserved across all state transitions.
  • Fixed compilation error where dbg::NoDrop was unavailable in release mode

Added

  • Added GuardState enum to represent armed/disarmed state
  • Added toggle() method to all drop guard types (returns GuardState indicating new state):
    • DropGuardMsg::toggle() - Toggles between armed and disarmed states
    • DropGuardEmpty::toggle() - Toggles between armed and disarmed states
    • DropGuardNoOp::toggle() - Toggles between armed and disarmed states
  • Added DropGuardMsg::set_msg() method to change the panic message while preserving the armed/disarmed state
  • Added verification benchmarks.