From 604348b230bebe0a90d03f3f3858e5174e919120 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:00:37 +0100 Subject: [PATCH] Remove unused code --- crates/fj-kernel/src/services/mod.rs | 5 +---- crates/fj-kernel/src/services/objects.rs | 17 +---------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/crates/fj-kernel/src/services/mod.rs b/crates/fj-kernel/src/services/mod.rs index 346a3ef7a..d40d4a825 100644 --- a/crates/fj-kernel/src/services/mod.rs +++ b/crates/fj-kernel/src/services/mod.rs @@ -13,7 +13,7 @@ use parking_lot::Mutex; use crate::objects::Objects; pub use self::{ - objects::{InsertObject, Operation, ServiceObjectsExt}, + objects::{InsertObject, Operation}, service::{Service, State}, validation::{Validation, ValidationFailed}, }; @@ -23,9 +23,6 @@ pub struct Services { /// The objects service /// /// Allows for inserting objects into a store after they were created. - /// - /// [`ServiceObjectsExt`] is available to provide a convenient API around - /// this service. pub objects: Service, /// The validation service diff --git a/crates/fj-kernel/src/services/objects.rs b/crates/fj-kernel/src/services/objects.rs index d5f530fa8..d7b387fed 100644 --- a/crates/fj-kernel/src/services/objects.rs +++ b/crates/fj-kernel/src/services/objects.rs @@ -1,6 +1,6 @@ use crate::objects::{Object, Objects, WithHandle}; -use super::{Service, State}; +use super::State; impl State for Objects { type Command = Operation; @@ -23,9 +23,6 @@ pub enum Operation { /// /// This is the one primitive operation that all other operations are built /// upon. - /// - /// You might prefer to use [`ServiceObjectsExt::insert`], which is a - /// convenient wrapper around `Service::execute`. InsertObject { /// The object to insert object: Object, @@ -38,15 +35,3 @@ pub struct InsertObject { /// The object to insert pub object: Object, } - -/// Convenient API for `Service` -pub trait ServiceObjectsExt { - /// Insert an object - fn insert(&mut self, object: Object); -} - -impl ServiceObjectsExt for Service { - fn insert(&mut self, object: Object) { - self.execute(Operation::InsertObject { object }); - } -}