Fix paths search
This commit is contained in:
parent
fc6b2c5fef
commit
d0840fd63b
3 changed files with 38 additions and 1 deletions
|
@ -993,7 +993,7 @@
|
|||
Math.min(results_returned[fullId].lev, returned);
|
||||
}
|
||||
if (index !== -1 || lev <= MAX_LEV_DISTANCE) {
|
||||
if (index !== -1) {
|
||||
if (index !== -1 && paths.length < 2) {
|
||||
lev = 0;
|
||||
}
|
||||
if (results[fullId] === undefined) {
|
||||
|
|
18
src/test/rustdoc-js/pinbox-new.js
Normal file
18
src/test/rustdoc-js/pinbox-new.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
// 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 = 'pinbox::new';
|
||||
|
||||
const EXPECTED = {
|
||||
'others': [
|
||||
{ 'path': 'std::boxed::PinBox', 'name': 'new' },
|
||||
{ 'path': 'alloc::boxed::PinBox', 'name': 'new' },
|
||||
],
|
||||
};
|
19
src/test/rustdoc-js/vec-new.js
Normal file
19
src/test/rustdoc-js/vec-new.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// 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 = 'Vec::new';
|
||||
|
||||
const EXPECTED = {
|
||||
'others': [
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'std::vec::Vec', 'name': 'ne' },
|
||||
{ 'path': 'std::boxed::PinBox', 'name': 'new' },
|
||||
],
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue