@@ -106,7 +106,7 @@ fn hash_slice<T>(slice: &[T]) -> u64 {
106
106
/// let edges_observer = StdMapObserver::from_ownedref("edges", OwnedMutSlice::from(vec![0u8; 16]));
107
107
/// // inform the feedback to track indices (required by IndexesLenTimeMinimizerScheduler), but not novelties
108
108
/// // this *MUST* be done before it is passed to MaxMapFeedback!
109
- /// let edges_observer = edges_observer.with_tracking::<true, false> ();
109
+ /// let edges_observer = edges_observer.with_index_tracking ();
110
110
///
111
111
/// // init the feedback
112
112
/// let mut feedback = MaxMapFeedback::new(&edges_observer);
@@ -127,19 +127,20 @@ fn hash_slice<T>(slice: &[T]) -> u64 {
127
127
///
128
128
/// [`MapObserver`] implementors: see [`StdMapObserver`] for an example implementation.
129
129
pub trait TrackingHinted {
130
- /// The resulting type, including the new tracking hints, after calling
131
- /// [`crate::observers::map::TrackingHint::with_tracking`].
132
- type Output < const NEW_INDICES : bool , const NEW_NOVELTIES : bool > : TrackingHinted ;
130
+ /// The resulting type of enabling index tracking.
131
+ type WithIndexTracking : TrackingHinted ;
132
+ /// The resulting type of enabling index tracking.
133
+ type WithNoveltiesTracking : TrackingHinted ;
133
134
134
135
/// Whether indices should be tracked for this [`MapObserver`].
135
136
const INDICES : bool ;
136
137
/// Whether novelties should be tracked for this [`MapObserver`].
137
138
const NOVELTIES : bool ;
138
139
139
- /// Make this map observer into one with the provided tracking hints .
140
- fn with_tracking < const NEW_INDICES : bool , const NEW_NOVELTIES : bool > (
141
- self ,
142
- ) -> Self :: Output < NEW_INDICES , NEW_NOVELTIES > ;
140
+ /// Convert this map observer into one that tracks indices .
141
+ fn with_index_tracking ( self ) -> Self :: WithIndexTracking ;
142
+ /// Convert this map observer into one that tracks novelties.
143
+ fn with_novelty_tracking ( self ) -> Self :: WithNoveltiesTracking ;
143
144
}
144
145
145
146
/// Module which holds the necessary functions and types for map-relevant macros, namely
@@ -187,7 +188,7 @@ pub mod macros {
187
188
SPACING , "= note: index tracking is required by " , $name, "\n " ,
188
189
SPACING , "= note: see the documentation of TrackingHinted for details\n " ,
189
190
SPACING , "|\n " ,
190
- SPACING , "= hint: call `.with_tracking::<true, ...> ()` on the map observer present in the following error notes\n " ,
191
+ SPACING , "= hint: call `.with_index_tracking ()` on the map observer present in the following error notes\n " ,
191
192
SPACING , "|\n " ,
192
193
SPACING , "| " ,
193
194
) ;
@@ -237,7 +238,7 @@ pub mod macros {
237
238
SPACING , "= note: novelty tracking is required by " , $name, "\n " ,
238
239
SPACING , "= note: see the documentation of TrackingHinted for details\n " ,
239
240
SPACING , "|\n " ,
240
- SPACING , "= hint: call `.with_tracking::<..., true> ()` on the map observer present in the following error notes\n " ,
241
+ SPACING , "= hint: call `.with_novelty_tracking ()` on the map observer present in the following error notes\n " ,
241
242
SPACING , "|\n " ,
242
243
SPACING , "| " ,
243
244
) ;
@@ -869,16 +870,22 @@ impl<'a, T, const DIFFERENTIAL: bool, const ITH: bool, const NTH: bool> Tracking
869
870
where
870
871
T : Copy + Default + Serialize ,
871
872
{
872
- type Output < const NEW_INDICES : bool , const NEW_NOVELTIES : bool > =
873
- StdMapObserver < ' a , T , DIFFERENTIAL , NEW_INDICES , NEW_NOVELTIES > ;
873
+ type WithIndexTracking = StdMapObserver < ' a , T , DIFFERENTIAL , true , NTH > ;
874
+ type WithNoveltiesTracking = StdMapObserver < ' a , T , DIFFERENTIAL , ITH , true > ;
874
875
875
876
const INDICES : bool = ITH ;
876
877
const NOVELTIES : bool = NTH ;
877
878
878
- fn with_tracking < const NEW_INDICES : bool , const NEW_NOVELTIES : bool > (
879
- self ,
880
- ) -> Self :: Output < NEW_INDICES , NEW_NOVELTIES > {
881
- StdMapObserver :: < ' a , T , DIFFERENTIAL , NEW_INDICES , NEW_NOVELTIES > {
879
+ fn with_index_tracking ( self ) -> Self :: WithIndexTracking {
880
+ StdMapObserver :: < ' a , T , DIFFERENTIAL , true , NTH > {
881
+ map : self . map ,
882
+ initial : self . initial ,
883
+ name : self . name ,
884
+ }
885
+ }
886
+
887
+ fn with_novelty_tracking ( self ) -> Self :: WithNoveltiesTracking {
888
+ StdMapObserver :: < ' a , T , DIFFERENTIAL , ITH , true > {
882
889
map : self . map ,
883
890
initial : self . initial ,
884
891
name : self . name ,
0 commit comments