Skip to content

Commit b778a85

Browse files
committed
renaming/docs fixes
1 parent e39b630 commit b778a85

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

fuzzers/libfuzzer_stb_image/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn fuzz(corpus_dirs: &[PathBuf], objective_dir: PathBuf, broker_port: u16) -> Re
6868

6969
// Create an observation channel using the coverage map
7070
// We don't use the hitcounts (see the Cargo.toml, we use pcguard_edges)
71-
let edges_observer = unsafe { std_edges_map_observer("edges").with_index_tracking() };
71+
let edges_observer = unsafe { std_edges_map_observer("edges").track_indices() };
7272

7373
// Create an observation channel to keep track of the execution time
7474
let time_observer = TimeObserver::new("time");

libafl/src/observers/map.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn hash_slice<T>(slice: &[T]) -> u64 {
8585
/// ensure that edge metadata is recorded as is appropriate for the provided observer.
8686
///
8787
/// If you get a type constraint failure for your map due to this type being unfulfilled, you must
88-
/// call [`TrackingHinted::with_index_tracking`] or [`TrackingHinted::with_novelty_tracking`] **at
88+
/// call [`TrackingHinted::track_indices`] or [`TrackingHinted::track_novelties`] **at
8989
/// the initialisation site of your map**.
9090
///
9191
/// This trait allows various components which interact with map metadata to ensure that the
@@ -111,7 +111,7 @@ fn hash_slice<T>(slice: &[T]) -> u64 {
111111
/// let edges_observer = StdMapObserver::from_ownedref("edges", OwnedMutSlice::from(vec![0u8; 16]));
112112
/// // inform the feedback to track indices (required by IndexesLenTimeMinimizerScheduler), but not novelties
113113
/// // this *MUST* be done before it is passed to MaxMapFeedback!
114-
/// let edges_observer = edges_observer.with_index_tracking();
114+
/// let edges_observer = edges_observer.track_indices();
115115
///
116116
/// // init the feedback
117117
/// let mut feedback = MaxMapFeedback::new(&edges_observer);
@@ -134,7 +134,7 @@ fn hash_slice<T>(slice: &[T]) -> u64 {
134134
pub trait TrackingHinted {
135135
/// The resulting type of enabling index tracking.
136136
type WithIndexTracking: TrackingHinted;
137-
/// The resulting type of enabling index tracking.
137+
/// The resulting type of enabling novelty tracking.
138138
type WithNoveltiesTracking: TrackingHinted;
139139

140140
/// Whether indices should be tracked for this [`MapObserver`].
@@ -143,9 +143,9 @@ pub trait TrackingHinted {
143143
const NOVELTIES: bool;
144144

145145
/// Convert this map observer into one that tracks indices.
146-
fn with_index_tracking(self) -> Self::WithIndexTracking;
146+
fn track_indices(self) -> Self::WithIndexTracking;
147147
/// Convert this map observer into one that tracks novelties.
148-
fn with_novelty_tracking(self) -> Self::WithNoveltiesTracking;
148+
fn track_novelties(self) -> Self::WithNoveltiesTracking;
149149
}
150150

151151
/// Struct which wraps [`MapObserver`] instances to explicitly give them tracking data.
@@ -164,11 +164,11 @@ impl<T, const ITH: bool, const NTH: bool> TrackingHinted for ExplicitTracking<T,
164164
const INDICES: bool = ITH;
165165
const NOVELTIES: bool = NTH;
166166

167-
fn with_index_tracking(self) -> Self::WithIndexTracking {
167+
fn track_indices(self) -> Self::WithIndexTracking {
168168
ExplicitTracking::<T, true, NTH>(self.0)
169169
}
170170

171-
fn with_novelty_tracking(self) -> Self::WithNoveltiesTracking {
171+
fn track_novelties(self) -> Self::WithNoveltiesTracking {
172172
ExplicitTracking::<T, ITH, true>(self.0)
173173
}
174174
}
@@ -292,7 +292,7 @@ pub mod macros {
292292
SPACING, "= note: index tracking is required by ", $name, "\n",
293293
SPACING, "= note: see the documentation of TrackingHinted for details\n",
294294
SPACING, "|\n",
295-
SPACING, "= hint: call `.with_index_tracking()` on the map observer present in the following error notes\n",
295+
SPACING, "= hint: call `.track_indices()` on the map observer present in the following error notes\n",
296296
SPACING, "|\n",
297297
SPACING, "| ",
298298
);
@@ -343,7 +343,7 @@ pub mod macros {
343343
SPACING, "= note: novelty tracking is required by ", $name, "\n",
344344
SPACING, "= note: see the documentation of TrackingHinted for details\n",
345345
SPACING, "|\n",
346-
SPACING, "= hint: call `.with_novelty_tracking()` on the map observer present in the following error notes\n",
346+
SPACING, "= hint: call `.track_novelties()` on the map observer present in the following error notes\n",
347347
SPACING, "|\n",
348348
SPACING, "| ",
349349
);
@@ -402,11 +402,11 @@ where
402402
const INDICES: bool = false;
403403
const NOVELTIES: bool = false;
404404

405-
fn with_index_tracking(self) -> Self::WithIndexTracking {
405+
fn track_indices(self) -> Self::WithIndexTracking {
406406
ExplicitTracking::<Self, true, false>(self)
407407
}
408408

409-
fn with_novelty_tracking(self) -> Self::WithNoveltiesTracking {
409+
fn track_novelties(self) -> Self::WithNoveltiesTracking {
410410
ExplicitTracking::<Self, false, true>(self)
411411
}
412412
}

0 commit comments

Comments
 (0)