diff --git a/src/context.rs b/src/context.rs index f96b14d..6171514 100644 --- a/src/context.rs +++ b/src/context.rs @@ -21,7 +21,7 @@ macro_rules! define_plugin { ($plugin:ident, $data_container:ty, $default: expr) => { struct $plugin {} - impl Plugin for $plugin { + impl $crate::context::Plugin for $plugin { type DataContainer = $data_container; fn get_data_container() -> Self::DataContainer { diff --git a/src/global_properties.rs b/src/global_properties.rs index ed675f9..ac84c3d 100644 --- a/src/global_properties.rs +++ b/src/global_properties.rs @@ -2,7 +2,7 @@ use std::any::{Any, TypeId}; use std::collections::HashMap; use std::rc::Rc; -use crate::context::{Context, Plugin}; +use crate::context::Context; use crate::data_containers::heterogeneous_container::HeterogeneousContainer; use crate::data_containers::Property; @@ -14,11 +14,11 @@ macro_rules! define_global_property { ($global_property:ident, $value:ty) => { pub struct $global_property {} - impl Property for $global_property { + impl $crate::data_containers::Property for $global_property { type Value = $value; } - impl GlobalProperty for $global_property {} + impl $crate::global_properties::GlobalProperty for $global_property {} }; } pub use define_global_property; @@ -121,8 +121,7 @@ impl GlobalPropertyContext for Context { #[cfg(test)] mod test { use crate::context::Context; - use crate::data_containers::Property; - use crate::global_properties::{GlobalProperty, GlobalPropertyContext}; + use crate::global_properties::GlobalPropertyContext; define_global_property!(PropertyA, usize); diff --git a/src/groups.rs b/src/groups.rs index 0fa1e58..38ccd2a 100644 --- a/src/groups.rs +++ b/src/groups.rs @@ -1,4 +1,4 @@ -use crate::context::{Context, Plugin}; +use crate::context::Context; use crate::data_containers::vector_person_container::VecPersonContainer; use crate::data_containers::{PersonContainer, PropertyWithDefault}; use crate::people::PersonId; diff --git a/src/partitions.rs b/src/partitions.rs index 88e1bd6..678d90d 100644 --- a/src/partitions.rs +++ b/src/partitions.rs @@ -1,6 +1,6 @@ extern crate rand; -use crate::context::{Context, Plugin}; +use crate::context::Context; use crate::data_containers::indexset_person_container::IndexSetPersonContainer; use crate::data_containers::PersonContainer; use crate::people::{PeopleContext, PersonId}; @@ -305,13 +305,11 @@ impl InternalPartitionContext for Context { #[cfg(test)] mod test { use crate::context::Context; - use crate::data_containers::{PersonContainer, PropertyWithDefault}; + use crate::data_containers::PersonContainer; use crate::define_person_property; use crate::partitions::{Partition, PartitionContext}; use crate::people::{PeopleContext, PersonId}; - use crate::person_properties::{ - PersonProperty, PersonPropertyContext, PersonPropertyPartitionBuilder, - }; + use crate::person_properties::{PersonPropertyContext, PersonPropertyPartitionBuilder}; use rand::prelude::StdRng; use rand::{Rng, SeedableRng}; use std::collections::HashSet; diff --git a/src/people.rs b/src/people.rs index 51c0e95..2bf2528 100644 --- a/src/people.rs +++ b/src/people.rs @@ -1,4 +1,4 @@ -use crate::context::{Context, Plugin}; +use crate::context::Context; use crate::creation::CreationBuilder; use std::any::{Any, TypeId}; use std::cell::RefCell; @@ -139,7 +139,7 @@ impl PeopleContext for Context { #[cfg(test)] mod tests { - use crate::context::{Context, Plugin}; + use crate::context::Context; use super::{PeopleContext, PersonId}; diff --git a/src/person_properties.rs b/src/person_properties.rs index ba9fc80..3db7ff2 100644 --- a/src/person_properties.rs +++ b/src/person_properties.rs @@ -2,7 +2,7 @@ use std::any::{Any, TypeId}; use std::collections::HashMap; use std::rc::Rc; -use crate::context::{Context, Plugin}; +use crate::context::Context; use crate::data_containers::vector_heterogeneous_container::VecDataContainer; use crate::data_containers::PropertyWithDefault; use crate::partitions::{Partition, PartitionBuilder, PartitionUpdateCallbackProvider}; @@ -15,7 +15,7 @@ macro_rules! define_person_property { ($person_property:ident, $value:ty, $default: expr) => { pub struct $person_property {} - impl PropertyWithDefault for $person_property { + impl $crate::data_containers::PropertyWithDefault for $person_property { type Value = $value; fn get_default() -> Self::Value { @@ -23,7 +23,7 @@ macro_rules! define_person_property { } } - impl PersonProperty for $person_property {} + impl $crate::person_properties::PersonProperty for $person_property {} }; } pub use define_person_property; @@ -31,7 +31,7 @@ pub use define_person_property; #[macro_export] macro_rules! define_person_property_from_enum { ($person_property:ty, $default: expr) => { - impl PropertyWithDefault for $person_property { + impl $crate::data_containers::PropertyWithDefault for $person_property { type Value = $person_property; fn get_default() -> Self::Value { @@ -39,7 +39,7 @@ macro_rules! define_person_property_from_enum { } } - impl PersonProperty for $person_property {} + impl $crate::person_properties::PersonProperty for $person_property {} impl Copy for $person_property {} @@ -233,10 +233,9 @@ impl<'a, P: Partition> PersonPropertyPartitionBuilder<'a, P> for PartitionBuilde #[cfg(test)] mod test { use crate::context::{Component, Context}; - use crate::data_containers::PropertyWithDefault; use crate::people::PeopleContext; use crate::person_properties::{ - PersonId, PersonPropertiesPersonBuilder, PersonProperty, PersonPropertyContext, + PersonId, PersonPropertiesPersonBuilder, PersonPropertyContext, }; define_person_property!(PropertyOne, usize, 0); diff --git a/src/random.rs b/src/random.rs index 7ac3bcb..303d5df 100644 --- a/src/random.rs +++ b/src/random.rs @@ -1,4 +1,4 @@ -use crate::context::{Context, Plugin}; +use crate::context::Context; use rand::SeedableRng; use std::any::{Any, TypeId}; use std::cell::{RefCell, RefMut}; diff --git a/src/regions.rs b/src/regions.rs index 9dd6795..a595f42 100644 --- a/src/regions.rs +++ b/src/regions.rs @@ -1,4 +1,4 @@ -use crate::context::{Context, Plugin}; +use crate::context::Context; use crate::creation::CreationBuilder; use crate::data_containers::vector_heterogeneous_container::VecDataContainer; use crate::data_containers::PropertyWithDefault; @@ -26,7 +26,7 @@ macro_rules! define_region_property { ($region_property:ident, $value:ty, $default: expr) => { pub struct $region_property {} - impl PropertyWithDefault for $region_property { + impl $crate::data_containers::PropertyWithDefault for $region_property { type Value = $value; fn get_default() -> Self::Value { @@ -34,7 +34,7 @@ macro_rules! define_region_property { } } - impl RegionProperty for $region_property {} + impl $crate::regions::RegionProperty for $region_property {} }; } pub use define_region_property; @@ -271,13 +271,13 @@ impl<'a, P: Partition> RegionsPartitionBuilder<'a, P> for PartitionBuilder<'a, P #[cfg(test)] mod test { - use crate::context::{Component, Context, Plugin}; - use crate::data_containers::{PersonContainer, PropertyWithDefault}; + use crate::context::{Component, Context}; + use crate::data_containers::PersonContainer; use crate::partitions::{Partition, PartitionContext}; use crate::people::PeopleContext; use crate::regions::{ - RegionId, RegionPropertiesCreationBuilder, RegionProperty, RegionsContext, - RegionsPartitionBuilder, RegionsPersonBuilder, + RegionId, RegionPropertiesCreationBuilder, RegionsContext, RegionsPartitionBuilder, + RegionsPersonBuilder, }; define_region_property!(RegionPropertyA, f64, 0.0); diff --git a/src/reports.rs b/src/reports.rs index a674833..428062d 100644 --- a/src/reports.rs +++ b/src/reports.rs @@ -1,4 +1,4 @@ -use crate::context::{Context, Plugin}; +use crate::context::Context; use serde::Serialize; use std::any::{Any, TypeId}; use std::collections::HashMap; @@ -113,7 +113,7 @@ where #[cfg(test)] mod test { - use crate::context::{Context, Plugin}; + use crate::context::Context; use crate::reports::{ get_channel_report_handler, get_file_report_handler, Report, ReportsContext, };