Calculate stability, const_stability, and deprecation on-demand
Previously, they would always be calculated ahead of time, which bloated the size of `clean::Item`.
This commit is contained in:
parent
d8d3ab96aa
commit
1523f67f16
7 changed files with 75 additions and 80 deletions
|
@ -17,17 +17,8 @@ use crate::json::JsonRenderer;
|
|||
impl JsonRenderer<'_> {
|
||||
pub(super) fn convert_item(&self, item: clean::Item) -> Option<Item> {
|
||||
let item_type = ItemType::from(&item);
|
||||
let clean::Item {
|
||||
source,
|
||||
name,
|
||||
attrs,
|
||||
kind,
|
||||
visibility,
|
||||
def_id,
|
||||
stability: _,
|
||||
const_stability: _,
|
||||
deprecation,
|
||||
} = item;
|
||||
let deprecation = item.deprecation(self.tcx);
|
||||
let clean::Item { source, name, attrs, kind, visibility, def_id } = item;
|
||||
match kind {
|
||||
clean::StrippedItem(_) => None,
|
||||
_ => Some(Item {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue