Skip to content

Commit

Permalink
Remove the blanket implementation for reference of Automaton
Browse files Browse the repository at this point in the history
  • Loading branch information
momvart committed Nov 16, 2024
1 parent c6b1f8e commit d2814f6
Showing 1 changed file with 0 additions and 84 deletions.
84 changes: 0 additions & 84 deletions src/automaton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,90 +636,6 @@ pub unsafe trait Automaton: private::Sealed {
}
}

// SAFETY: This just defers to the underlying 'AcAutomaton' and thus inherits
// its safety properties.
unsafe impl<'a, A: Automaton + ?Sized> Automaton for &'a A {
#[inline(always)]
fn start_state(&self, anchored: Anchored) -> Result<StateID, MatchError> {
(**self).start_state(anchored)
}

#[inline(always)]
fn next_state(
&self,
anchored: Anchored,
sid: StateID,
byte: u8,
) -> StateID {
(**self).next_state(anchored, sid, byte)
}

#[inline(always)]
fn is_special(&self, sid: StateID) -> bool {
(**self).is_special(sid)
}

#[inline(always)]
fn is_dead(&self, sid: StateID) -> bool {
(**self).is_dead(sid)
}

#[inline(always)]
fn is_match(&self, sid: StateID) -> bool {
(**self).is_match(sid)
}

#[inline(always)]
fn is_start(&self, sid: StateID) -> bool {
(**self).is_start(sid)
}

#[inline(always)]
fn match_kind(&self) -> MatchKind {
(**self).match_kind()
}

#[inline(always)]
fn match_len(&self, sid: StateID) -> usize {
(**self).match_len(sid)
}

#[inline(always)]
fn match_pattern(&self, sid: StateID, index: usize) -> PatternID {
(**self).match_pattern(sid, index)
}

#[inline(always)]
fn patterns_len(&self) -> usize {
(**self).patterns_len()
}

#[inline(always)]
fn pattern_len(&self, pid: PatternID) -> usize {
(**self).pattern_len(pid)
}

#[inline(always)]
fn min_pattern_len(&self) -> usize {
(**self).min_pattern_len()
}

#[inline(always)]
fn max_pattern_len(&self) -> usize {
(**self).max_pattern_len()
}

#[inline(always)]
fn memory_usage(&self) -> usize {
(**self).memory_usage()
}

#[inline(always)]
fn prefilter(&self) -> Option<&Prefilter> {
(**self).prefilter()
}
}

/// Represents the current state of an overlapping search.
///
/// This is used for overlapping searches since they need to know something
Expand Down

0 comments on commit d2814f6

Please sign in to comment.