Skip to content

Commit 1ff4df6

Browse files
committed
Bump versions to 0.1.450 and tidy macros
Update workspace package version to 0.1.450 and apply minor formatting updates to Cargo.toml files. Refactor rustapi-macros logic: fix the validate_path_syntax match guard to correctly check allowed characters outside braces, and simplify parameter meta parsing by combining the Meta::Path arm with a guard to reduce nesting and clarify intent. No large behavioral changes expected.
1 parent 688c8d2 commit 1ff4df6

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ members = [
1717
]
1818

1919
[workspace.package]
20-
version = "0.1.449"
20+
version = "0.1.450"
2121
edition = "2021"
2222
authors = ["RustAPI Contributors, Tuntii"]
2323
license = "MIT OR Apache-2.0"
@@ -145,3 +145,4 @@ strip = false
145145

146146

147147

148+

crates/rustapi-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ replay = ["dep:async-trait"]
116116

117117

118118

119+

crates/rustapi-macros/src/lib.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,18 @@ fn validate_path_syntax(path: &str, span: proc_macro2::Span) -> Result<(), syn::
390390
param_start = None;
391391
}
392392
// Check for invalid characters in path (outside of parameters)
393-
_ if brace_depth == 0 => {
393+
_ if brace_depth == 0
394394
// Allow alphanumeric, -, _, ., /, and common URL characters
395-
if !ch.is_alphanumeric() && !"-_./*".contains(ch) {
396-
return Err(syn::Error::new(
397-
span,
398-
format!(
399-
"invalid character '{}' at position {} in route path: \"{}\"",
400-
ch, i, path
401-
),
402-
));
403-
}
395+
&& !ch.is_alphanumeric() && !"-_./*".contains(ch) => {
396+
return Err(syn::Error::new(
397+
span,
398+
format!(
399+
"invalid character '{}' at position {} in route path: \"{}\"",
400+
ch, i, path
401+
),
402+
));
404403
}
404+
_ if brace_depth == 0 => {}
405405
_ => {}
406406
}
407407
}
@@ -660,11 +660,9 @@ fn generate_route_handler(method: &str, attr: TokenStream, item: TokenStream) ->
660660
for meta in param_args {
661661
match &meta {
662662
// Simple ident: #[param(id, ...)]
663-
Meta::Path(path) => {
664-
if param_name.is_none() {
665-
if let Some(ident) = path.get_ident() {
666-
param_name = Some(ident.to_string());
667-
}
663+
Meta::Path(path) if param_name.is_none() => {
664+
if let Some(ident) = path.get_ident() {
665+
param_name = Some(ident.to_string());
668666
}
669667
}
670668
// Named value: #[param(schema = "uuid")] or #[param(id = "uuid")]

0 commit comments

Comments
 (0)