Skip to content

Commit

Permalink
hex-literal: ensure '/' as last byte causes error in hex!() (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascastleman committed Nov 11, 2021
1 parent 63c8e60 commit 04a1550
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hex-literal/CHANGELOG.md
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- More tests for `hex!()` macro
- More internal documentation

### Fixed
- Make `hex!()` error when forward slash encountered as last byte

## 0.3.3 (2021-07-17)
### Added
- Accept sequence of string literals ([#519])
Expand Down
2 changes: 2 additions & 0 deletions hex-literal/src/comments.rs
Expand Up @@ -28,6 +28,8 @@ impl<I: Iterator<Item = u8>> Iterator for ExcludingComments<I> {
State::BlockComment | State::PotentiallyLeavingBlockComment => {
panic!("block comment not terminated with */")
}
// No more bytes after a single '/'
State::PotentialComment { .. } => panic!("encountered invalid character: `/`"),
_ => {}
}
}
Expand Down

0 comments on commit 04a1550

Please sign in to comment.