Skip to content

Commit

Permalink
Make IsInserted more useful
Browse files Browse the repository at this point in the history
Requiring the `Borrow` trait here allows code that is generic over
`IsInserted` to call methods on `T`.
  • Loading branch information
hannobraun committed Aug 2, 2023
1 parent 9354257 commit e82d79b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/fj-core/src/operations/insert/is_inserted.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::borrow::Borrow;

use crate::storage::Handle;

/// Indicate whether an object has been inserted
Expand All @@ -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<T>;
type T<T>: Borrow<T>;
}

/// Indicate that an object has been inserted
Expand Down

0 comments on commit e82d79b

Please sign in to comment.