internal: explain that we don't ref in style.md

This commit is contained in:
Aleksey Kladov 2021-08-02 15:59:28 +03:00
parent 5f3662e01c
commit 12d7f5b56e
8 changed files with 31 additions and 20 deletions

View file

@ -217,7 +217,7 @@ impl Crate {
let doc_url = doc_attr_q.tt_values().map(|tt| {
let name = tt.token_trees.iter()
.skip_while(|tt| !matches!(tt, TokenTree::Leaf(Leaf::Ident(Ident{text: ref ident, ..})) if ident == "html_root_url"))
.skip_while(|tt| !matches!(tt, TokenTree::Leaf(Leaf::Ident(Ident { text, ..} )) if text == "html_root_url"))
.nth(2);
match name {
@ -2397,9 +2397,9 @@ impl Type {
}
pub fn fields(&self, db: &dyn HirDatabase) -> Vec<(Field, Type)> {
let (variant_id, substs) = match *self.ty.kind(&Interner) {
TyKind::Adt(hir_ty::AdtId(AdtId::StructId(s)), ref substs) => (s.into(), substs),
TyKind::Adt(hir_ty::AdtId(AdtId::UnionId(u)), ref substs) => (u.into(), substs),
let (variant_id, substs) = match self.ty.kind(&Interner) {
TyKind::Adt(hir_ty::AdtId(AdtId::StructId(s)), substs) => ((*s).into(), substs),
TyKind::Adt(hir_ty::AdtId(AdtId::UnionId(u)), substs) => ((*u).into(), substs),
_ => return Vec::new(),
};