From e82d79bf99279b57a6b27ac4d71987369d6c1696 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 2 Aug 2023 11:24:29 +0200 Subject: [PATCH] Make `IsInserted` more useful Requiring the `Borrow` trait here allows code that is generic over `IsInserted` to call methods on `T`. --- crates/fj-core/src/operations/insert/is_inserted.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/insert/is_inserted.rs b/crates/fj-core/src/operations/insert/is_inserted.rs index dd4d00a95..992e2f43d 100644 --- a/crates/fj-core/src/operations/insert/is_inserted.rs +++ b/crates/fj-core/src/operations/insert/is_inserted.rs @@ -1,3 +1,5 @@ +use std::borrow::Borrow; + use crate::storage::Handle; /// Indicate whether an object has been inserted @@ -6,7 +8,7 @@ use crate::storage::Handle; /// whether their contents have been inserted or not. pub trait IsInserted { /// The type of the object for which the insertion status is tracked - type T; + type T: Borrow; } /// Indicate that an object has been inserted