Add specific never search

This commit is contained in:
Guillaume Gomez 2018-04-07 14:04:03 +02:00
parent d2577ca1ec
commit 654cb84852
2 changed files with 23 additions and 1 deletions

View File

@ -1062,6 +1062,11 @@
type = matches[1].replace(/^const$/, 'constant');
query = query.substring(matches[0].length);
}
// In case we just get a '!' as input, we can assume that the user is looking for the
// `Never` primitive type.
if (raw === '!') {
query = 'Never';
}
return {
raw: raw,
@ -1369,7 +1374,7 @@
function search(e) {
var params = getQueryStringParams();
var query = getQuery(document.getElementsByClassName('search-input')[0].value);
var query = getQuery(document.getElementsByClassName('search-input')[0].value.trim());
if (e) {
e.preventDefault();

View File

@ -0,0 +1,17 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
const QUERY = '!';
const EXPECTED = {
'others': [
{ 'path': 'std', 'name': 'never' },
],
};