From 6f9a460fef36c427f477db4c3c2712267408fcff Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 27 Jun 2022 11:07:45 -0700 Subject: [PATCH] Put back, fix ()-output optimization --- src/librustdoc/html/render/mod.rs | 1 + src/librustdoc/html/static/js/search.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index b01afa02b8b..1ef41d62e5e 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -170,6 +170,7 @@ impl Serialize for IndexItemFunctionType { _ => seq.serialize_element(&self.inputs)?, } match &self.output[..] { + [] => {} [one] if one.generics.is_none() => seq.serialize_element(one)?, _ => seq.serialize_element(&self.output)?, } diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index a766dd68e10..46fab7ee57b 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -1910,7 +1910,7 @@ function initSearch(rawSearchIndex) { output = buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA], lowercasePaths); } } else { - output = null; + output = []; } return { inputs, output,