Skip to main content

str_is_under

Function str_is_under 

Source
pub fn str_is_under(path: &str, prefix: &str) -> bool
Expand description

Segment-wise “is path at or below prefix?” for the string form, used by the log module’s per-subtree handlers where prefixes arrive as text.

This replaces path == prefix || path.starts_with(&format!("{prefix}.")) — same answer, no allocation, and the dot rule falls out of the comparison instead of being bolted on.