Skip to content

Commit

Permalink
fix: use 0-based index
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <usamoi@outlook.com>
  • Loading branch information
usamoi committed May 28, 2024
1 parent 0c57ad4 commit f86433b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ where
let s = unsafe { std::str::from_utf8_unchecked(&token[1..]) };
index = s
.parse::<usize>()
.map_err(|_| ParseVectorError::BadParsing { position })?
- 1;
.map_err(|_| ParseVectorError::BadParsing { position })?;
token.clear();
} else {
return Err(ParseVectorError::TooShortNumber { position });
Expand Down

0 comments on commit f86433b

Please sign in to comment.