Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Mar 23, 2023
1 parent 2eb0f43 commit 604348b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
5 changes: 1 addition & 4 deletions crates/fj-kernel/src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};
Expand All @@ -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<Objects>,

/// The validation service
Expand Down
17 changes: 1 addition & 16 deletions crates/fj-kernel/src/services/objects.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::objects::{Object, Objects, WithHandle};

use super::{Service, State};
use super::State;

impl State for Objects {
type Command = Operation;
Expand All @@ -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<Objects>::execute`.
InsertObject {
/// The object to insert
object: Object<WithHandle>,
Expand All @@ -38,15 +35,3 @@ pub struct InsertObject {
/// The object to insert
pub object: Object<WithHandle>,
}

/// Convenient API for `Service<Objects>`
pub trait ServiceObjectsExt {
/// Insert an object
fn insert(&mut self, object: Object<WithHandle>);
}

impl ServiceObjectsExt for Service<Objects> {
fn insert(&mut self, object: Object<WithHandle>) {
self.execute(Operation::InsertObject { object });
}
}

0 comments on commit 604348b

Please sign in to comment.