From bc2315943b47ce84985ea51bd56dd0ea2b6dd1e3 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Tue, 19 Apr 2022 13:13:29 -0700 Subject: [PATCH] Allow 'unused_doc_comments' on generated doctests. --- core/codegen/src/bang/test_guide.rs | 1 + site/guide/5-responses.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/codegen/src/bang/test_guide.rs b/core/codegen/src/bang/test_guide.rs index 6c61e748..faa9b560 100644 --- a/core/codegen/src/bang/test_guide.rs +++ b/core/codegen/src/bang/test_guide.rs @@ -29,6 +29,7 @@ fn entry_to_tests(root_glob: &LitStr) -> Result, Box let ident = Ident::new(&name.to_lowercase(), root_glob.span()); let full_path = Path::new(&manifest_dir).join(&path).display().to_string(); tests.push(quote_spanned!(root_glob.span() => + #[allow(unused_doc_comments)] mod #ident { macro_rules! doc_comment { ($x:expr) => (#[doc = $x] extern {}); } doc_comment!(include_str!(#full_path)); diff --git a/site/guide/5-responses.md b/site/guide/5-responses.md index bfa6b332..e511be07 100644 --- a/site/guide/5-responses.md +++ b/site/guide/5-responses.md @@ -672,9 +672,9 @@ generated. #[get("//?")] fn person(id: Option, name: &str, age: Option) { /* .. */ } -/// Note that `id` is `Option` in the route, but `id` in `uri!` _cannot_ -/// be an `Option`. `age`, on the other hand, _must_ be an `Option` (or `Result` -/// or `_`) as its in the query part and is allowed to be ignored. +// Note that `id` is `Option` in the route, but `id` in `uri!` _cannot_ +// be an `Option`. `age`, on the other hand, _must_ be an `Option` (or `Result` +// or `_`) as its in the query part and is allowed to be ignored. let mike = uri!(person(id = 101, name = "Mike", age = Some(28))); assert_eq!(mike.to_string(), "/101/Mike?age=28"); ```