mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 23:17:42 +02:00
compile time validation of path (#2350)
* compile time validation of path * added trybuild err message * Update Cargo.toml * add changelog entry * test more cases of path validation * fmt Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
committed by
GitHub
parent
4bb32fb19b
commit
168b2f227d
@ -3,6 +3,7 @@ extern crate proc_macro;
|
||||
use std::collections::HashSet;
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use actix_router::ResourceDef;
|
||||
use proc_macro::TokenStream;
|
||||
use proc_macro2::{Span, TokenStream as TokenStream2};
|
||||
use quote::{format_ident, quote, ToTokens, TokenStreamExt};
|
||||
@ -101,6 +102,7 @@ impl Args {
|
||||
match arg {
|
||||
NestedMeta::Lit(syn::Lit::Str(lit)) => match path {
|
||||
None => {
|
||||
let _ = ResourceDef::new(lit.value());
|
||||
path = Some(lit);
|
||||
}
|
||||
_ => {
|
||||
|
Reference in New Issue
Block a user