rustdoc-search: removed dead parser code

This is already covered by the normal unexpected char path.
This commit is contained in:
Michael Howell 2023-11-29 10:23:42 -07:00
parent c28de27a73
commit 93f17117ed
2 changed files with 9 additions and 2 deletions

View File

@ -473,8 +473,6 @@ function initSearch(rawSearchIndex) {
const path = name.trim();
if (path.length === 0 && generics.length === 0) {
throw ["Unexpected ", parserState.userQuery[parserState.pos]];
} else if (path === "*") {
throw ["Unexpected ", "*"];
}
if (query.literalSearch && parserState.totalElems - parserState.genericsElems > 0) {
throw ["Cannot have more than one element if you use quotes"];

View File

@ -17,6 +17,15 @@ const PARSED = [
userQuery: "-> <p>",
error: "Found generics without a path",
},
{
query: '-> *',
elems: [],
foundElems: 0,
original: "-> *",
returned: [],
userQuery: "-> *",
error: "Unexpected `*`",
},
{
query: 'a<"P">',
elems: [],