diff --git a/Cargo.toml b/Cargo.toml index 76687b5..bba781f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "charred" -version = "0.3.4" +version = "0.3.5" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/tapemachine.rs b/src/tapemachine.rs index b8d963b..4f4cf39 100644 --- a/src/tapemachine.rs +++ b/src/tapemachine.rs @@ -118,6 +118,13 @@ impl CharTapeMachine { } } + /// Seeks one character and returns + /// if it seeked or an error occurred + #[inline] + pub fn try_seek(&mut self) -> bool { + self.seek_one().is_ok() + } + /// Seeks any character of the given group until none is encountered anymore pub fn seek_any(&mut self, chars: &[char]) -> TapeResult<()> { while self.check_any(chars) {