From e58a34820ed4bf71a061fc08d262ec1a3f6c3548 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 22 Jan 2021 23:11:48 +0100 Subject: [PATCH] Expose index the TapeError occured on Signed-off-by: trivernis --- Cargo.toml | 2 +- src/tapemachine.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bba781f..eea0eac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "charred" -version = "0.3.5" +version = "0.3.6" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/tapemachine.rs b/src/tapemachine.rs index 4f4cf39..0868682 100644 --- a/src/tapemachine.rs +++ b/src/tapemachine.rs @@ -10,6 +10,11 @@ impl TapeError { pub fn new(index: usize) -> Self { Self { index } } + + /// Returns the index the error occured on + pub fn get_index(&self) -> usize { + self.index + } } impl Display for TapeError {