Make StepCursor::advance private
diff --git a/src/parse.rs b/src/parse.rs
index 3c62641..dfca478 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -221,17 +221,6 @@
}
impl<'c, 'a> StepCursor<'c, 'a> {
- /// Produces a cursor suitable for returning within the `R` return value of
- /// a `ParseStream::step` invocation.
- ///
- /// # Performance
- ///
- /// This method performs a very small fixed amount of work independent of
- /// the distance between `to` and the prior position of the stream.
- pub fn advance(self, to: Cursor<'c>) -> Cursor<'a> {
- unsafe { mem::transmute::<Cursor<'c>, Cursor<'a>>(to) }
- }
-
/// Triggers an error at the current position of the parse stream.
///
/// The `ParseStream::step` invocation will return this same error without
@@ -241,6 +230,13 @@
}
}
+impl private {
+ pub fn advance_step_cursor<'c, 'a>(proof: StepCursor<'c, 'a>, to: Cursor<'c>) -> Cursor<'a> {
+ let _ = proof;
+ unsafe { mem::transmute::<Cursor<'c>, Cursor<'a>>(to) }
+ }
+}
+
fn skip(input: ParseStream) -> bool {
input
.step(|cursor| {