Skip to content

Commit d29d56d

Browse files
committed
nits
1 parent b3f2296 commit d29d56d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/tree.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<T> Node<T> {
199199
let next = remaining[0];
200200

201201
// For parameters with a suffix, we have to find the matching suffix or create a new child node.
202-
if matches!(state.node().node_type, NodeType::Param { .. }) {
202+
if let NodeType::Param { suffix: has_suffix } = state.node().node_type {
203203
let terminator = remaining
204204
.iter()
205205
.position(|&b| b == b'/')
@@ -248,9 +248,10 @@ impl<T> Node<T> {
248248
priority: 1,
249249
..Node::default()
250250
});
251-
let has_suffix = matches!(state.node().node_type, NodeType::Param { suffix: true })
252-
|| !matches!(*suffix, b"" | b"/");
251+
252+
let has_suffix = has_suffix || !matches!(*suffix, b"" | b"/");
253253
state.node_mut().node_type = NodeType::Param { suffix: has_suffix };
254+
254255
state = state.set_child(child);
255256

256257
// If this is the final route segment, insert the value.

0 commit comments

Comments
 (0)