diff --git a/crates/fj-kernel/src/insert.rs b/crates/fj-kernel/src/insert.rs index 50e9bb063..90b50ff41 100644 --- a/crates/fj-kernel/src/insert.rs +++ b/crates/fj-kernel/src/insert.rs @@ -25,7 +25,7 @@ macro_rules! impl_insert { fn insert(self, objects: &mut Service) -> Handle { let handle = objects.$store.reserve(); - objects.insert(handle.clone(), self); + objects.insert((handle.clone(), self).into()); handle } } diff --git a/crates/fj-kernel/src/services/objects.rs b/crates/fj-kernel/src/services/objects.rs index fb919d04f..d5f530fa8 100644 --- a/crates/fj-kernel/src/services/objects.rs +++ b/crates/fj-kernel/src/services/objects.rs @@ -1,7 +1,4 @@ -use crate::{ - objects::{Object, Objects, WithHandle}, - storage::Handle, -}; +use crate::objects::{Object, Objects, WithHandle}; use super::{Service, State}; @@ -45,18 +42,11 @@ pub struct InsertObject { /// Convenient API for `Service` pub trait ServiceObjectsExt { /// Insert an object - fn insert(&mut self, handle: Handle, object: T) - where - (Handle, T): Into>; + fn insert(&mut self, object: Object); } impl ServiceObjectsExt for Service { - fn insert(&mut self, handle: Handle, object: T) - where - (Handle, T): Into>, - { - self.execute(Operation::InsertObject { - object: (handle, object).into(), - }); + fn insert(&mut self, object: Object) { + self.execute(Operation::InsertObject { object }); } }