Skip to content

Commit d82838a

Browse files
committed
fix(stackable-versioned): allow various formatting styles for macro in testing regex
1 parent cb4218b commit d82838a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/stackable-versioned-macros/src/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::versioned_impl;
1515
const DELIMITER: &str = "// ---\n";
1616

1717
static REGEX: LazyLock<Regex> = LazyLock::new(|| {
18-
Regex::new(r"#\[versioned\(\n(?P<args>[[:ascii:]]+)\n\)\]")
18+
Regex::new(r"#\[versioned\(\s*(?P<args>[[:ascii:]]+)\s*\)\]")
1919
.expect("failed to compile versioned regex")
2020
});
2121

@@ -55,7 +55,7 @@ fn prepare_from_string(input: String) -> Result<(TokenStream, DeriveInput), Erro
5555

5656
let attrs = REGEX
5757
.captures(attrs)
58-
.unwrap()
58+
.expect("the regex did not match")
5959
.name("args")
6060
.context(MissingRegexMatchGroupSnafu)?
6161
.as_str();

0 commit comments

Comments
 (0)