Skip to content

Commit

Permalink
removes offset method from InvalidEncodingERror
Browse files Browse the repository at this point in the history
  • Loading branch information
chanced committed Jul 10, 2024
1 parent bf73713 commit 6f2fe5c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,6 @@ pub struct InvalidEncodingError {
pub offset: usize,
}

impl InvalidEncodingError {
/// The byte offset of the first invalid `~`.
pub fn offset(&self) -> usize {
self.offset
}
}

impl fmt::Display for InvalidEncodingError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
Expand Down Expand Up @@ -462,12 +455,6 @@ mod tests {
assert!(Token::from_encoded("a~a").is_err());
}

#[test]
fn invalid_encoding_offset() {
let err = InvalidEncodingError { offset: 3 };
assert_eq!(err.offset(), 3);
}

#[test]
fn into_owned() {
let token = Token::from_encoded("foo~0").unwrap().into_owned();
Expand Down

0 comments on commit 6f2fe5c

Please sign in to comment.