From 2451f873f1e9acde672a8dc696325d4f6518217f Mon Sep 17 00:00:00 2001 From: kampersanda Date: Sun, 17 Sep 2023 13:30:37 +0900 Subject: [PATCH] add comment --- src/trie.rs | 4 ++++ tests/tests.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/trie.rs b/src/trie.rs index 189f471..59634e2 100644 --- a/src/trie.rs +++ b/src/trie.rs @@ -131,6 +131,10 @@ impl Sparse { continue 'a; } } + // If edges allow all label values from x00 to xFF, such unreachable instances can be + // created. However, this would not happen in trie-match because only string literals + // are allowed, and xFF will never appear. + // (See hogehoge) unreachable!("No unused base found"); } (bases, checks, values) diff --git a/tests/tests.rs b/tests/tests.rs index 44e1f8a..f46d6f3 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -129,6 +129,11 @@ fn test_try_base_conflict() { // This test confirms that check[0] does not have an invalid value of zero. #[test] fn test_invalid_root_check() { + // [0] -x01-> [1] + // \-x00-> [0] ? If check[0] is 0, such an invalid transition is possible. + // + // base: [0, MAX] + // check: [0, 1] let f = |text| { trie_match! { match text {