From 5e1b82ba6d19cf4755f86223e73fe8221c0a2181 Mon Sep 17 00:00:00 2001 From: Maaz Ahmed <maaz.a@subcom.tech> Date: Tue, 2 Jan 2024 12:46:18 +0530 Subject: [PATCH] qol: impl Operable on references of Operable types as well --- src/lib.rs | 2 ++ src/query/ops/mod.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9c9cfeb..bdb837e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -215,6 +215,8 @@ pub enum Method { // them directly mod seal { pub trait Sealed {} + impl<T: Sealed> Sealed for &T {} + impl<T: Sealed> Sealed for &mut T {} } /// Signifies that a query has been validated through some of the validation methods diff --git a/src/query/ops/mod.rs b/src/query/ops/mod.rs index d53fd75..254213f 100644 --- a/src/query/ops/mod.rs +++ b/src/query/ops/mod.rs @@ -31,3 +31,6 @@ pub use logic::Logical; /// Marker trait for signifying that a type can be used with the operators pub trait Operable: Display + Sealed {} + +impl<T: Operable> Operable for &T {} +impl<T: Operable> Operable for &mut T {} -- GitLab