Fix test-rustdoc (#1266)

* Fix `test-rustdoc`

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
This commit is contained in:
Bastian Köcher
2023-08-29 21:23:38 +02:00
committed by GitHub
parent 430edd7535
commit 9acb06717e
30 changed files with 71 additions and 73 deletions
@@ -22,7 +22,6 @@ use crate::{
Def,
},
};
use itertools::Itertools;
use quote::ToTokens;
use std::{collections::HashMap, ops::IndexMut};
use syn::spanned::Spanned;
@@ -443,11 +442,14 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream {
let cfg_attrs = &storage.cfg_attrs;
// If the storage item is public, just link to it rather than copy-pasting the docs.
// If the storage item is public, link it and otherwise just mention it.
//
// We can not just copy the docs from a non-public type as it may links to internal
// types which makes the compiler very unhappy :(
let getter_doc_line = if matches!(storage.vis, syn::Visibility::Public(_)) {
format!("An auto-generated getter for [`{}`].", storage.ident)
} else {
storage.docs.iter().map(|d| d.into_token_stream().to_string()).join("\n")
format!("An auto-generated getter for `{}`.", storage.ident)
};
match &storage.metadata {