We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use the #[router] attribute with multiple services that use #[data] arguments, the generated code doesn't clone #[data].
Example code:
#[router( "/tata/", services( svc1, svc2, svc3 ) )] pub fn my_router( #[data] config: AppConfig, #[data] mongo: MongoClient, #[data] vault: Arc<dyn Vault>, ) {}
Errors:
29 | #[data] config: AppConfig, | ^^^^^^ | | | value moved here | value used here after move
Generated code by cargo expand:
pub fn my_router( config: AppConfig, mongo: MongoClient, vault: Arc<dyn Vault>, ) -> impl Clone + rweb::Filter<Extract = (impl rweb::Reply,), Error = rweb::Rejection> { use rweb::{rt::StatusCode, Filter}; rweb::openapi::with(|__collector: Option<&mut rweb::openapi::Collector>| { if let Some(__collector) = __collector { __collector.with_appended_prefix("/tata/", ::alloc::vec::Vec::new(), || { rweb::filters::path::path("tata").and( svc1(config, mongo, vault) .or(svc2(config, mongo, vault)) .or(svc3(config, mongo, vault)), ) }) } else { rweb::filters::path::path("tata").and( svc1(config, mongo, vault) .or(svc2(config, mongo, vault)) .or(svc3(config, mongo, vault)), ) } }) }
Data arguments should be cloned in methods calls.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I use the #[router] attribute with multiple services that use #[data] arguments, the generated code doesn't clone #[data].
Example code:
Errors:
Generated code by cargo expand:
Data arguments should be cloned in methods calls.
The text was updated successfully, but these errors were encountered: