Skip to content

Commit c373ec9

Browse files
committed
fix(guard): correct match parameter order
Signed-off-by: azjezz <[email protected]>
1 parent 0545cd2 commit c373ec9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/guard/src/matcher.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ pub const SEPARATOR: char = '\\';
1616
/// - `**`: Matches any number of segments (including zero).
1717
/// - Segments can also contain `*` for partial matches (e.g., `*Repository`).
1818
/// * `is_constant`: If `true`, the last segment of the FQN is matched case-sensitively.
19+
/// * `treat_as_namespace`: If `true`, the pattern is treated as a namespace, meaning it matches
20+
/// any FQN that starts with the pattern.
1921
///
2022
/// # Returns
2123
///
2224
/// `true` if the `fqcn` matches the `pattern`, `false` otherwise.
23-
pub fn matches(fqcn: &str, pattern: &str, treat_as_namespace: bool, is_constant: bool) -> bool {
25+
pub fn matches(fqcn: &str, pattern: &str, is_constant: bool, treat_as_namespace: bool) -> bool {
2426
if !pattern.contains('*') {
2527
let p = pattern.trim_matches(SEPARATOR);
2628
let f = fqcn.trim_matches(SEPARATOR);

0 commit comments

Comments
 (0)