Skip to content

Commit

Permalink
rule: invalid utf8 test
Browse files Browse the repository at this point in the history
  • Loading branch information
chensoft committed May 4, 2024
1 parent f792d73 commit a2efb4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [0.2.1] - 2024-05-0x
## [0.2.1] - 2024-05-04

### Changed

Expand Down Expand Up @@ -29,12 +29,9 @@

## Todo

- invalid utf8 test with regex matches: &[0xffu8, 0xfe, 0x65];
- intoiterator
-
- benchmark
- plain only mode
- item sep customizable
- re-balance on removed node
- invalid utf8 test: &[0xffu8, 0xfe, 0x65];
- intoiterator post order
- entry support
4 changes: 4 additions & 0 deletions src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ impl RadixRule {
/// assert!(RadixRule::from_regex(r"{[0-9}").is_err()); // missing ]
/// assert!(RadixRule::from_regex(r"{:(0}").is_err()); // missing )
/// assert!(RadixRule::from_regex(r"{id:(0}").is_err()); // missing )
///
/// #[allow(invalid_from_utf8_unchecked)]
/// let invalid = format!("{{{}}}", unsafe { std::str::from_utf8_unchecked(&[0xffu8, 0xfe, 0x65]) });
/// assert!(RadixRule::from_regex(invalid).is_err());
/// ```
#[inline]
pub fn from_regex(frag: impl Into<Bytes>) -> RadixResult<Self> {
Expand Down

0 comments on commit a2efb4e

Please sign in to comment.