From 32c8f7dbcf17e8a97a3a99e112e86a604d12f0a2 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Wed, 9 Apr 2025 20:51:52 +0800 Subject: librustdoc: remove IndexItem::new, use previous fields constructor Signed-off-by: xizheyin --- src/librustdoc/html/render/mod.rs | 56 +++++++++------------------------------ 1 file changed, 12 insertions(+), 44 deletions(-) (limited to 'src/librustdoc/html/render') diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index b9a2e65b090..ad6fa110ae8 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -113,50 +113,18 @@ enum RenderMode { /// by hand to a large JS file at the end of cache-creation. #[derive(Debug)] pub(crate) struct IndexItem { - ty: ItemType, - defid: Option, - name: Symbol, - path: String, - desc: String, - parent: Option, - parent_idx: Option, - exact_path: Option, - impl_id: Option, - search_type: Option, - aliases: Box<[Symbol]>, - deprecation: Option, -} - -impl IndexItem { - pub fn new( - ty: ItemType, - defid: Option, - name: Symbol, - path: String, - desc: String, - parent: Option, - parent_idx: Option, - exact_path: Option, - impl_id: Option, - search_type: Option, - aliases: Box<[Symbol]>, - deprecation: Option, - ) -> Self { - Self { - ty, - defid, - name, - path, - desc, - parent, - parent_idx, - exact_path, - impl_id, - search_type, - aliases, - deprecation, - } - } + pub(crate) ty: ItemType, + pub(crate) defid: Option, + pub(crate) name: Symbol, + pub(crate) path: String, + pub(crate) desc: String, + pub(crate) parent: Option, + pub(crate) parent_idx: Option, + pub(crate) exact_path: Option, + pub(crate) impl_id: Option, + pub(crate) search_type: Option, + pub(crate) aliases: Box<[Symbol]>, + pub(crate) deprecation: Option, } /// A type used for the search index. -- cgit 1.4.1-3-g733a5