From 39bc8df30343fbc1c6b0fa73ea379068af257a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=AF=E5=87=9B?= Date: Mon, 27 Apr 2026 16:37:25 +0800 Subject: [PATCH] feat: implement `Not` for `StdLib` --- src/stdlib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/stdlib.rs b/src/stdlib.rs index 48111fed..e1c32e9a 100644 --- a/src/stdlib.rs +++ b/src/stdlib.rs @@ -1,4 +1,4 @@ -use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign}; +use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not}; /// Flags describing the set of lua standard libraries to load. #[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] @@ -144,3 +144,10 @@ impl BitXorAssign for StdLib { *self = StdLib(self.0 ^ rhs.0) } } + +impl Not for StdLib { + type Output = Self; + fn not(self) -> Self::Output { + StdLib(!self.0) + } +}