mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add specific never search
This commit is contained in:
parent
d2577ca1ec
commit
654cb84852
@ -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();
|
||||
|
17
src/test/rustdoc-js/never.js
Normal file
17
src/test/rustdoc-js/never.js
Normal 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' },
|
||||
],
|
||||
};
|
Loading…
Reference in New Issue
Block a user