From 89c238f9c82ade2d7656e2bee76838a391609a88 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 5 Aug 2023 23:14:06 +0200 Subject: refactor!: remove IDependencyHistory BREAKING CHANGE: IDependencyHistory has been removed as part of an effort to simplify the API. This affects IDIContainer, DIContainer, IAsyncDIContainer, AsyncDIContainer, Injectable, AsyncInjectable, BindingBuilder, AsyncBindingBuilder, BindingScopeConfigurator, BindingWhenConfigurator, AsyncBindingScopeConfigurator, AsyncBindingWhenConfigurator and DependencyHistory --- src/dependency_history.rs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/dependency_history.rs') diff --git a/src/dependency_history.rs b/src/dependency_history.rs index 4e36a7b..cd4e77d 100644 --- a/src/dependency_history.rs +++ b/src/dependency_history.rs @@ -7,18 +7,6 @@ use std::fmt::{Debug, Display}; const BOLD_MODE: &str = "\x1b[1m"; const RESET_BOLD_MODE: &str = "\x1b[22m"; -/// Dependency history interface. -/// -/// **This trait is sealed and cannot be implemented for types outside this crate.** -pub trait IDependencyHistory: private::Sealed -{ - #[doc(hidden)] - fn push(&mut self); - - #[doc(hidden)] - fn contains(&self) -> bool; -} - /// Dependency history. #[derive(Clone, Debug)] pub struct DependencyHistory @@ -35,16 +23,18 @@ impl DependencyHistory } } -impl IDependencyHistory for DependencyHistory +#[cfg_attr(test, mockall::automock)] +impl DependencyHistory { #[doc(hidden)] - fn push(&mut self) + pub fn push(&mut self) { self.inner.push(type_name::()); } #[doc(hidden)] - fn contains(&self) -> bool + #[allow(clippy::must_use_candidate)] + pub fn contains(&self) -> bool { self.inner.contains(&type_name::()) } -- cgit v1.2.3-18-g5258