Brian Silverman | 4e662aa | 2022-05-11 23:10:19 -0700 | [diff] [blame^] | 1 | // Copyright 2022 Google LLC |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 4 | // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 5 | // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your |
| 6 | // option. This file may not be copied, modified, or distributed |
| 7 | // except according to those terms. |
| 8 | |
| 9 | use proc_macro2::Span; |
| 10 | use syn::{parse_quote, Attribute}; |
| 11 | |
| 12 | pub(crate) fn make_doc_attrs(label: String) -> Vec<Attribute> { |
| 13 | let hexathorpe = syn::token::Pound(Span::call_site()); |
| 14 | vec![parse_quote! { |
| 15 | #hexathorpe [doc = #label] |
| 16 | }] |
| 17 | } |