"));
@@ -1726,7 +1731,7 @@ impl<'a> fmt::Show for Sidebar<'a> {
fn build_sidebar(m: &clean::Module) -> HashMap<~str, Vec<~str> > {
let mut map = HashMap::new();
for item in m.items.iter() {
- let short = shortty(item);
+ let short = shortty(item).to_static_str();
let myname = match item.name {
None => continue,
Some(ref s) => s.to_owned(),
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 1904ab27d17d9..4b79ae89eef6b 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -9,7 +9,7 @@
// except according to those terms.
/*jslint browser: true, es5: true */
-/*globals $: true, rootPath: true, allPaths: true */
+/*globals $: true, rootPath: true */
(function() {
"use strict";
@@ -135,7 +135,7 @@
function execQuery(query, max, searchWords) {
var valLower = query.query.toLowerCase(),
val = valLower,
- typeFilter = query.type,
+ typeFilter = itemTypeFromName(query.type),
results = [],
split = valLower.split("::");
@@ -156,7 +156,7 @@
for (var i = 0; i < nSearchWords; i += 1) {
if (searchWords[i] === val) {
// filter type: ... queries
- if (!typeFilter || typeFilter === searchIndex[i].ty) {
+ if (typeFilter < 0 || typeFilter === searchIndex[i].ty) {
results.push({id: i, index: -1});
}
}
@@ -174,7 +174,7 @@
searchWords[j].replace(/_/g, "").indexOf(val) > -1)
{
// filter type: ... queries
- if (!typeFilter || typeFilter === searchIndex[j].ty) {
+ if (typeFilter < 0 || typeFilter === searchIndex[j].ty) {
results.push({id: j, index: searchWords[j].replace(/_/g, "").indexOf(val)});
}
}
@@ -258,7 +258,7 @@
var result = results[i],
name = result.item.name.toLowerCase(),
path = result.item.path.toLowerCase(),
- parent = allPaths[result.item.crate][result.item.parent];
+ parent = result.item.parent;
var valid = validateResult(name, path, split, parent);
if (!valid) {
@@ -405,7 +405,7 @@
shown.push(item);
name = item.name;
- type = item.ty;
+ type = itemTypes[item.ty];
output += '