diff --git a/Dockerfile b/Dockerfile index 61223e9c1..427820604 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,7 +69,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ RUN mkdir -p /opt/docsrs/prefix COPY --from=build /build/target/release/cratesfyi /usr/local/bin -COPY css /opt/docsrs/prefix/public_html +COPY static /opt/docsrs/prefix/public_html COPY templates /opt/docsrs/templates COPY docker-entrypoint.sh /opt/docsrs/entrypoint.sh diff --git a/css/FiraSans-Medium.woff b/css/FiraSans-Medium.woff deleted file mode 100644 index 7d742c5fb..000000000 Binary files a/css/FiraSans-Medium.woff and /dev/null differ diff --git a/css/FiraSans-Regular.woff b/css/FiraSans-Regular.woff deleted file mode 100644 index d8e0363f4..000000000 Binary files a/css/FiraSans-Regular.woff and /dev/null differ diff --git a/css/SourceCodePro-Regular.woff b/css/SourceCodePro-Regular.woff deleted file mode 100644 index 557667090..000000000 Binary files a/css/SourceCodePro-Regular.woff and /dev/null differ diff --git a/css/SourceCodePro-Semibold.woff b/css/SourceCodePro-Semibold.woff deleted file mode 100644 index ca972a11d..000000000 Binary files a/css/SourceCodePro-Semibold.woff and /dev/null differ diff --git a/css/SourceSerifPro-Bold.woff b/css/SourceSerifPro-Bold.woff deleted file mode 100644 index ac1b1b3a0..000000000 Binary files a/css/SourceSerifPro-Bold.woff and /dev/null differ diff --git a/css/SourceSerifPro-It.ttf.woff b/css/SourceSerifPro-It.ttf.woff deleted file mode 100644 index a287bbe6e..000000000 Binary files a/css/SourceSerifPro-It.ttf.woff and /dev/null differ diff --git a/css/SourceSerifPro-Regular.ttf.woff b/css/SourceSerifPro-Regular.ttf.woff deleted file mode 100644 index a3d55cfdf..000000000 Binary files a/css/SourceSerifPro-Regular.ttf.woff and /dev/null differ diff --git a/css/SourceSerifPro-Regular.woff b/css/SourceSerifPro-Regular.woff deleted file mode 100644 index e8c43b852..000000000 Binary files a/css/SourceSerifPro-Regular.woff and /dev/null differ diff --git a/css/brush-20191010-1.40.0-nightly-898f36c83.svg b/css/brush-20191010-1.40.0-nightly-898f36c83.svg deleted file mode 100644 index 072264a64..000000000 --- a/css/brush-20191010-1.40.0-nightly-898f36c83.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/css/main-20160526-1.10.0-nightly-97e3a2401.css b/css/main-20160526-1.10.0-nightly-97e3a2401.css deleted file mode 100644 index 59b2ff7e3..000000000 --- a/css/main-20160526-1.10.0-nightly-97e3a2401.css +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Copyright 2015 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 or the MIT license - * , at your - * option. This file may not be copied, modified, or distributed - * except according to those terms. - */ - -/* General structure and fonts */ - -body { - background-color: white; - color: black; -} - -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { - color: black; -} -h1.fqn { - border-bottom-color: #D5D5D5; -} -h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { - border-bottom-color: #DDDDDD; -} -.in-band, code { - background-color: white; -} - -.docblock code { - background-color: #F5F5F5; -} -pre { - background-color: #F5F5F5; -} - -.sidebar .location { - background: #e1e1e1; - color: #333; -} - -.block a:hover { - background: #F5F5F5; -} - -.line-numbers span { color: #c67e2d; } -.line-numbers .line-highlighted { - background-color: #f6fdb0 !important; -} - -:target { background: #FDFFD3; } -.content .highlighted { - color: #000 !important; - background-color: #ccc; -} -.content .highlighted a, .content .highlighted span { color: #000 !important; } -.content .highlighted.trait { background-color: #fece7e; } -.content .highlighted.mod { background-color: #afc6e4; } -.content .highlighted.enum { background-color: #b4d1b9; } -.content .highlighted.struct { background-color: #e7b1a0; } -.content .highlighted.fn { background-color: #c6afb3; } -.content .highlighted.method { background-color: #c6afb3; } -.content .highlighted.tymethod { background-color: #c6afb3; } -.content .highlighted.type { background-color: #c6afb3; } - -.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { - border-bottom-color: #DDD; -} - -.docblock table { - border-color: #ddd; -} - -.docblock table td { - border-top-color: #ddd; - border-bottom-color: #ddd; -} - -.docblock table th { - border-top-color: #ddd; - border-bottom-color: #ddd; -} - -.content a.primitive { color: #39a7bf; } -.content span.externcrate, span.mod, .content a.mod, block a.current.mod { color: #4d76ae; } -.content span.fn, .content a.fn, .block a.current.fn, -.content span.method, .content a.method, .block a.current.method, -.content span.tymethod, .content a.tymethod, .block a.current.tymethod, -.content .fnname { color: #8c6067; } - -pre.rust .comment { color: #8E908C; } -pre.rust .doccomment { color: #4D4D4C; } - -nav { - border-bottom-color: #e0e0e0; -} -nav.main .current { - border-top-color: #000; - border-bottom-color: #000; -} -nav.main .separator { - border-color: 1px solid #000; -} -a { - color: #000; -} - -.docblock a, .stability a { - color: #3873AD; -} - -a.test-arrow { - color: #f5f5f5; -} - -.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; } - -.search-input { - color: #555; - box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent; - background-color: white; -} - -em.stab.unstable { background: #FFF5D6; border-color: #FFC600; } -em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; } diff --git a/css/main-20191010-1.40.0-nightly-898f36c83.js b/css/main-20191010-1.40.0-nightly-898f36c83.js deleted file mode 100644 index 8ceaf0e7b..000000000 --- a/css/main-20191010-1.40.0-nightly-898f36c83.js +++ /dev/null @@ -1 +0,0 @@ -if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}function getSearchInput(){return document.getElementsByClassName("search-input")[0]}function getSearchElement(){return document.getElementById("search")}(function(){"use strict";var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var search_input=getSearchInput();var currentTab=0;var titleBeforeSearch=document.title;function getPageId(){var id=document.location.href.split("#")[1];if(id){return id.split("?")[0].split("&")[0]}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display="none"}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop="";var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display=null}}var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");onEachLazy(document.getElementsByClassName("js-only"),function(e){removeClass(e,"js-only")});function getQueryStringParams(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}var main=document.getElementById("main");function highlightSourceLines(ev){hideSidebar();var elem;var search=getSearchElement();var i,from,to,match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(match){from=parseInt(match[1],10);to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to0){collapseDocs(collapses[0],"show")}}}}highlightSourceLines(null);window.onhashchange=highlightSourceLines;function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}function getHelpElement(){return document.getElementById("help")}function displayHelp(display,ev,help){var help=help?help:getHelpElement();if(display===true){if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else if(hasClass(help,"hidden")===false){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}function handleEscape(ev){var help=getHelpElement();var search=getSearchElement();hideModal();if(hasClass(help,"hidden")===false){displayHelp(false,ev,help)}else if(hasClass(search,"hidden")===false){ev.preventDefault();addClass(search,"hidden");removeClass(main,"hidden");document.title=titleBeforeSearch}defocusSearchBar()}function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);hideModal();ev.preventDefault();focusSearchBar();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":if(ev.shiftKey){hideModal();displayHelp(true,ev)}break}}}function findParentElement(elem,tagName){do{if(elem&&elem.tagName===tagName){return elem}elem=elem.parentNode}while(elem);return null}document.onkeypress=handleShortcut;document.onkeydown=handleShortcut;document.onclick=function(ev){if(hasClass(ev.target,"collapse-toggle")){collapseDocs(ev.target,"toggle")}else if(hasClass(ev.target.parentNode,"collapse-toggle")){collapseDocs(ev.target.parentNode,"toggle")}else if(ev.target.tagName==="SPAN"&&hasClass(ev.target.parentNode,"line-numbers")){var prev_id=0;var set_fragment=function(name){if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines(null)}else{location.replace("#"+name)}};var cur_id=parseInt(ev.target.id,10);if(ev.shiftKey&&prev_id){if(prev_id>cur_id){var tmp=prev_id;prev_id=cur_id;cur_id=tmp}set_fragment(prev_id+"-"+cur_id)}else{prev_id=cur_id;set_fragment(cur_id)}}else if(hasClass(document.getElementById("help"),"hidden")===false){addClass(document.getElementById("help"),"hidden");removeClass(document.body,"blur")}else{var a=findParentElement(ev.target,"A");if(a&&a.hash){expandSection(a.hash.replace(/^#/,""))}}};var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=rootPath.match(/\.\.\//g).length+1;for(i=0;i-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;if(isType!==true||obj.type){var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(results.hasOwnProperty(entry)){ar.push(results[entry])}}results=ar;var i;var nresults=results.length;for(i=0;ib?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});var length=results.length;for(i=0;i"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function checkGenerics(obj,val){var lev_distance=MAX_LEV_DISTANCE+1;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var total=0;var done=0;var vlength=val.generics.length;for(var y=0;yGENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var allFound=true;for(var y=0;allFound===true&&yGENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}else{return 0}}if(literalSearch===true){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var length=obj[GENERICS_DATA].length;for(x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x0){var length=obj.type[INPUTS_DATA].length;for(var i=0;iOUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(!obj.type[OUTPUT_DATA].length){ret=[ret]}for(var x=0;xlength){return MAX_LEV_DISTANCE+1}for(var i=0;ilength){break}var lev_total=0;var aborted=false;for(var x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(aborted===false){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<0)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return(name=="associatedconstant");case"fn":return(name=="method"||name=="tymethod");case"type":return(name=="primitive"||name=="keyword")}return false}function generateId(ty){if(ty.parent&&ty.parent.name){return itemTypes[ty.ty]+ty.path+ty.parent.name+ty.name}return itemTypes[ty.ty]+ty.path+ty.name}var nSearchWords=searchWords.length;var i;var ty;var fullId;var returned;var in_args;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0;iOUTPUT_DATA?type[OUTPUT_DATA].name:"";returned=checkReturned(ty,output,true);if(output.name==="*"||returned===true){in_args=false;var is_module=false;if(input==="*"){is_module=true}else{var allFound=true;for(var it=0;allFound===true&&it1?paths.length-1:1);for(j=0;j1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=generateId(ty);if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||searchWords[j].replace(/_/g,"").indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=searchWords[j].replace(/_/g,"").indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){lev=MAX_LEV_DISTANCE+1}else{lev+=1}}if((in_args=findArg(ty,valGenerics))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){in_args=MAX_LEV_DISTANCE+1}}if((returned=checkReturned(ty,valGenerics))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){returned=MAX_LEV_DISTANCE+1}}lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(index!==-1||lev<=MAX_LEV_DISTANCE){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results),};if(ALIASES&&ALIASES[window.currentCrate]&&ALIASES[window.currentCrate][query.raw]){var aliases=ALIASES[window.currentCrate][query.raw];for(i=0;iMAX_RESULTS){ret.others.pop()}}}return ret}function validateResult(name,path,keys,parent){for(var i=0;i-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function initSearchNav(){var hoverTimeout;var click_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}var dst=e.target.getElementsByTagName("a");if(dst.length<1){return}dst=dst[0];if(window.location.pathname===dst.pathname){addClass(document.getElementById("search"),"hidden");removeClass(main,"hidden");document.location.href=dst.href}};var mouseover_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}clearTimeout(hoverTimeout);hoverTimeout=setTimeout(function(){onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){removeClass(i_e,"highlighted")})});addClass(el,"highlighted")},20)};onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){i_e.onclick=click_func;i_e.onmouseover=mouseover_func})});search_input.onkeydown=function(e){var actives=[[],[],[]];var current=0;onEachLazy(document.getElementById("results").childNodes,function(e){onEachLazy(e.getElementsByClassName("highlighted"),function(e){actives[current].push(e)});current+=1});if(e.which===38){if(!actives[currentTab].length||!actives[currentTab][0].previousElementSibling){return}addClass(actives[currentTab][0].previousElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}else if(e.which===40){if(!actives[currentTab].length){var results=document.getElementById("results").childNodes;if(results.length>0){var res=results[currentTab].getElementsByClassName("result");if(res.length>0){addClass(res[0],"highlighted")}}}else if(actives[currentTab][0].nextElementSibling){addClass(actives[currentTab][0].nextElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}}else if(e.which===13){if(actives[currentTab].length){document.location.href=actives[currentTab][0].getElementsByTagName("a")[0].href}}else if(e.which===9){if(e.shiftKey){printTab(currentTab>0?currentTab-1:2)}else{printTab(currentTab>1?0:currentTab+1)}e.preventDefault()}else if(e.which===16){}else if(e.which===27){handleEscape(e)}else if(actives[currentTab].length>0){removeClass(actives[currentTab][0],"highlighted")}}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;if(type==="mod"){displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];if(parentType==="primitive"){displayPath=myparent.name+"::"}else{displayPath=item.path+"::"+myparent.name+"::"}href=rootPath+item.path.replace(/::/g,"/")+"/"+parentType+"."+myparent.name+".html"+anchor}else{displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraStyle="";if(display===false){extraStyle=" style=\"display: none;\""}var output="";var duplicates={};var length=0;if(array.length>0){output="";array.forEach(function(item){var name,type;name=item.name;type=itemTypes[item.ty];if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}length+=1;output+=""});output+="
"+""+(item.is_alias===true?(""+item.alias+"  - see "):"")+item.displayPath+""+name+""+""+""+escape(item.desc)+" 
"}else{output="
No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:
"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(currentTab===tabNb){return"
"+text+"
("+nbElems+")
"}return"
"+text+"
("+nbElems+")
"}function showResults(results){if(results.others.length===1&&getCurrentValue("rustdoc-go-to-only-result")==="true"){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click()}var query=getQuery(search_input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var output="

Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"

"+"
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"+ret_others[0]+ret_in_args[0]+ret_returned[0]+"
";addClass(main,"hidden");var search=getSearchElement();removeClass(search,"hidden");search.innerHTML=output;var tds=search.getElementsByTagName("td");var td_width=0;if(tds.length>0){td_width=tds[0].offsetWidth}var width=search.offsetWidth-40-td_width;onEachLazy(search.getElementsByClassName("desc"),function(e){e.style.width=width+"px"});initSearchNav();var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0;itpositions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0;xpositions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}var queries=query.raw.split(",");var results={"in_args":[],"returned":[],"others":[],};for(var i=0;i1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}else{return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&rawSearchIndex.hasOwnProperty(elem.value)){return elem.value}return undefined}function search(e,forced){var params=getQueryStringParams();var query=getQuery(search_input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(forced!==true&&query.id===currentResults){if(query.query.length>0){putBackSearch(search_input)}return}document.title="Results for "+query.query+" - Rust";if(browserSupportsHistoryApi()){if(!history.state&&!params.search){history.pushState(query,"","?search="+encodeURIComponent(query.raw))}else{history.replaceState(query,"","?search="+encodeURIComponent(query.raw))}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates),filterCrates)}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i;for(var crate in rawSearchIndex){if(!rawSearchIndex.hasOwnProperty(crate)){continue}searchWords.push(crate);searchIndex.push({crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,type:null,});var items=rawSearchIndex[crate].i;var paths=rawSearchIndex[crate].p;var len=paths.length;for(i=0;i"+""+"
"+code.outerHTML+"
";list.appendChild(display)}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function onEveryMatchingChild(elem,className,func){if(elem&&className&&func){var length=elem.childNodes.length;var nodes=elem.childNodes;for(var i=0;i"+labelForToggleButton(sectionIsCollapsed)+"
]";return toggle}var toggle=createSimpleToggle(false);var hideMethodDocs=getCurrentValue("rustdoc-method-docs")==="true";var pageId=getPageId();var func=function(e){var next=e.nextElementSibling;if(!next){return}if(hasClass(next,"docblock")===true||(hasClass(next,"stability")===true&&hasClass(next.nextElementSibling,"docblock")===true)){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideMethodDocs===true&&hasClass(e,"method")===true){collapseDocs(newToggle,"hide",pageId)}}};var funcImpl=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"docblock")){next=next.nextElementSibling}if(!next){return}if(next.getElementsByClassName("method").length>0&&hasClass(e,"impl")){insertAfter(toggle.cloneNode(true),e.childNodes[e.childNodes.length-1])}};onEachLazy(document.getElementsByClassName("method"),func);onEachLazy(document.getElementsByClassName("associatedconstant"),func);onEachLazy(document.getElementsByClassName("impl"),funcImpl);var impl_call=function(){};if(hideMethodDocs===true){impl_call=function(e,newToggle,pageId){if(e.id.match(/^impl(?:-\d+)?$/)===null){if(hasClass(e,"impl")===true){collapseDocs(newToggle,"hide",pageId)}}}}var newToggle=document.createElement("a");newToggle.href="javascript:void(0)";newToggle.className="collapse-toggle hidden-default collapsed";newToggle.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items";function toggleClicked(){if(hasClass(this,"collapsed")){removeClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("hidden"),function(x){if(hasClass(x,"content")===false){removeClass(x,"hidden");addClass(x,"x")}},true);this.innerHTML="["+labelForToggleButton(false)+"] Hide undocumented items"}else{addClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("x"),function(x){if(hasClass(x,"content")===false){addClass(x,"hidden");removeClass(x,"x")}},true);this.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items"}}onEachLazy(document.getElementsByClassName("impl-items"),function(e){onEachLazy(e.getElementsByClassName("associatedconstant"),func);var hiddenElems=e.getElementsByClassName("hidden");var needToggle=false;var hlength=hiddenElems.length;for(var i=0;i0){inner[0].innerHTML="+"}}if(extraClass){addClass(wrapper,extraClass)}wrapper.appendChild(mainToggle);return wrapper}var showItemDeclarations=getCurrentValue("rustdoc-item-declarations")==="false";function buildToggleWrapper(e){if(hasClass(e,"autohide")){var wrap=e.previousElementSibling;if(wrap&&hasClass(wrap,"toggle-wrapper")){var inner_toggle=wrap.childNodes[0];var extra=e.childNodes[0].tagName==="H3";e.style.display="none";addClass(wrap,"collapsed");onEachLazy(inner_toggle.getElementsByClassName("inner"),function(e){e.innerHTML=labelForToggleButton(true)});onEachLazy(inner_toggle.getElementsByClassName("toggle-label"),function(e){e.style.display="inline-block";if(extra===true){i_e.innerHTML=" Show "+e.childNodes[0].innerHTML}})}}if(e.parentNode.id==="main"){var otherMessage="";var fontSize;var extraClass;if(hasClass(e,"type-decl")){fontSize="20px";otherMessage=" Show declaration";if(showItemDeclarations===false){extraClass="collapsed"}}else if(hasClass(e,"sub-variant")){otherMessage=" Show fields"}else if(hasClass(e,"non-exhaustive")){otherMessage=" This ";if(hasClass(e,"non-exhaustive-struct")){otherMessage+="struct"}else if(hasClass(e,"non-exhaustive-enum")){otherMessage+="enum"}else if(hasClass(e,"non-exhaustive-variant")){otherMessage+="enum variant"}else if(hasClass(e,"non-exhaustive-type")){otherMessage+="type"}otherMessage+=" is marked as non-exhaustive"}else if(hasClass(e.childNodes[0],"impl-items")){extraClass="marg-left"}e.parentNode.insertBefore(createToggle(otherMessage,fontSize,extraClass,hasClass(e,"type-decl")===false||showItemDeclarations===true),e);if(hasClass(e,"type-decl")===true&&showItemDeclarations===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}if(hasClass(e,"non-exhaustive")===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}}}onEachLazy(document.getElementsByClassName("docblock"),buildToggleWrapper);onEachLazy(document.getElementsByClassName("sub-variant"),buildToggleWrapper);function createToggleWrapper(tog){var span=document.createElement("span");span.className="toggle-label";span.style.display="none";span.innerHTML=" Expand attributes";tog.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper toggle-attributes";wrapper.appendChild(tog);return wrapper}var itemAttributesFunc=function(){};if(getCurrentValue("rustdoc-item-attributes")!=="false"){itemAttributesFunc=function(x){collapseDocs(x.previousSibling.childNodes[0],"toggle")}}var attributesToggle=createToggleWrapper(createSimpleToggle(false));onEachLazy(main.getElementsByClassName("attributes"),function(i_e){var attr_tog=attributesToggle.cloneNode(true);if(hasClass(i_e,"top-attr")===true){addClass(attr_tog,"top-attr")}i_e.parentNode.insertBefore(attr_tog,i_e);itemAttributesFunc(i_e)});var lineNumbersFunc=function(){};if(getCurrentValue("rustdoc-line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;i
✕"+"
"+content+"";document.getElementsByTagName("body")[0].appendChild(modal);document.getElementById("modal-close").onclick=hideModal;modal.onclick=hideModal}function hideModal(){var modal=document.getElementById("important");if(modal){modal.parentNode.removeChild(modal)}}onEachLazy(document.getElementsByClassName("important-traits"),function(e){e.onclick=function(){showModal(e.lastElementChild.innerHTML)}});function printTab(nb){if(nb===0||nb===1||nb===2){currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){elem.style.display=""}else{elem.style.display="none"}nb-=1})}function putBackSearch(search_input){if(search_input.value!==""){addClass(main,"hidden");removeClass(document.getElementById("search"),"hidden");if(browserSupportsHistoryApi()){history.replaceState(search_input.value,"","?search="+encodeURIComponent(search_input.value))}}}if(search_input){search_input.onfocus=function(){putBackSearch(this)}}var params=getQueryStringParams();if(params&¶ms.search){addClass(main,"hidden");var search=getSearchElement();removeClass(search,"hidden");search.innerHTML="

Loading search results...

"}var sidebar_menu=document.getElementsByClassName("sidebar-menu")[0];if(sidebar_menu){sidebar_menu.onclick=function(){var sidebar=document.getElementsByClassName("sidebar")[0];if(hasClass(sidebar,"mobile")===true){hideSidebar()}else{showSidebar()}}}window.onresize=function(){hideSidebar()};autoCollapse(getPageId(),getCurrentValue("rustdoc-collapse")==="true");if(window.location.hash&&window.location.hash.length>0){expandSection(window.location.hash.replace(/^#/,""))}if(main){onEachLazy(main.getElementsByClassName("loading-content"),function(e){e.remove()});onEachLazy(main.childNodes,function(e){if(e.tagName==="H2"||e.tagName==="H3"){var nextTagName=e.nextElementSibling.tagName;if(nextTagName=="H2"||nextTagName=="H3"){e.nextElementSibling.style.display="flex"}else{e.nextElementSibling.style.display="block"}}})}function addSearchOptions(crates){var elem=document.getElementById("crate-search");if(!elem){return}var crates_text=[];if(Object.keys(crates).length>1){for(var crate in crates){if(crates.hasOwnProperty(crate)){crates_text.push(crate)}}}crates_text.sort(function(a,b){var lower_a=a.toLowerCase();var lower_b=b.toLowerCase();if(lower_alower_b){return 1}return 0});for(var i=0;i or the MIT license - * , at your - * option. This file may not be copied, modified, or distributed - * except according to those terms. - */ - -/* See FiraSans-LICENSE.txt for the Fira Sans license. */ -@font-face { - font-family: 'Fira Sans'; - font-style: normal; - font-weight: 400; - src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff'); -} -@font-face { - font-family: 'Fira Sans'; - font-style: normal; - font-weight: 500; - src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff'); -} - -/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and - * Heuristica-LICENSE.txt for the Heuristica license. */ -@font-face { - font-family: 'Source Serif Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff'); -} -@font-face { - font-family: 'Source Serif Pro'; - font-style: italic; - font-weight: 400; - src: url("Heuristica-Italic.woff") format('woff'); -} -@font-face { - font-family: 'Source Serif Pro'; - font-style: normal; - font-weight: 700; - src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff'); -} - -/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */ -@font-face { - font-family: 'Source Code Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff'); -} -@font-face { - font-family: 'Source Code Pro'; - font-style: normal; - font-weight: 600; - src: local('Source Code Pro Semibold'), url("SourceCodePro-Semibold.woff") format('woff'); -} - -@import "normalize.css"; - -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -/* General structure and fonts */ - -body { - font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif; - margin: 0; - position: relative; - padding: 10px 15px 20px 15px; - - -webkit-font-feature-settings: "kern", "liga"; - -moz-font-feature-settings: "kern", "liga"; - font-feature-settings: "kern", "liga"; -} - -h1 { - font-size: 1.5em; -} -h2 { - font-size: 1.4em; -} -h3 { - font-size: 1.3em; -} -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { - font-weight: 500; - margin: 20px 0 15px 0; - padding-bottom: 6px; -} -h1.fqn { - border-bottom: 1px dashed; - margin-top: 0; - position: relative; -} -h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) { - border-bottom: 1px solid; -} -h3.impl, h3.method, h4.method, h3.type, h4.type { - font-weight: 600; - margin-top: 10px; - margin-bottom: 10px; - position: relative; -} -h3.impl, h3.method, h3.type { - margin-top: 15px; -} -h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - -ol, ul { - padding-left: 25px; -} -ul ul, ol ul, ul ol, ol ol { - margin-bottom: 0; -} - -p { - margin: 0 0 .6em 0; -} - -code, pre { - font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace; - white-space: pre-wrap; -} -.docblock code { - border-radius: 3px; - padding: 0 0.2em; -} -.docblock pre code { - padding: 0; -} -pre { - padding: 14px; -} - -.source pre { - padding: 20px; -} - -img { - max-width: 100%; -} - -.content.source { - margin-top: 50px; - max-width: none; - overflow: visible; - margin-left: 0px; - min-width: 70em; -} - -nav.sub { - font-size: 16px; - text-transform: uppercase; -} - -.sidebar { - width: 200px; - position: absolute; - left: 0; - top: 0; - min-height: 100%; -} - -.content, nav { max-width: 960px; } - -/* Everything else */ - -.js-only, .hidden { display: none !important; } - -.sidebar { - padding: 10px; -} -.sidebar img { - margin: 20px auto; - display: block; -} - -.sidebar .location { - font-size: 17px; - margin: 30px 0 20px 0; - text-align: center; -} - -.location a:first-child { font-weight: 500; } - -.block { - padding: 0 10px; - margin-bottom: 14px; -} -.block h2, .block h3 { - margin-top: 0; - margin-bottom: 8px; - text-align: center; -} -.block ul, .block li { - margin: 0; - padding: 0; - list-style: none; -} - -.block a { - display: block; - text-overflow: ellipsis; - overflow: hidden; - line-height: 15px; - padding: 7px 5px; - font-size: 14px; - font-weight: 300; - transition: border 500ms ease-out; -} - -.content { - padding: 15px 0; -} - -.content.source pre.rust { - white-space: pre; - overflow: auto; - padding-left: 0; -} -.content pre.line-numbers { - float: left; - border: none; - position: relative; - - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.line-numbers span { cursor: pointer; } - -.docblock.short p { - display: inline; -} - -.docblock.short.nowrap { - display: block; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.docblock.short p { - overflow: hidden; - text-overflow: ellipsis; - margin: 0; -} -.docblock.short code { white-space: nowrap; } - -.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { - border-bottom: 1px solid; -} - -.docblock h1 { font-size: 1.3em; } -.docblock h2 { font-size: 1.15em; } -.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; } - -.content .out-of-band { - font-size: 23px; - margin: 0px; - padding: 0px; - text-align: right; - display: inline-block; - font-weight: normal; - position: absolute; - right: 0; -} - -h3.impl > .out-of-band { - font-size: 21px; -} - -h4 > code, h3 > code { - position: inherit; -} - -.in-band, code { - z-index: 5; -} - -.content .in-band { - margin: 0px; - padding: 0px; - display: inline-block; -} - -#main { position: relative; } -#main > .since { - top: inherit; - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - -.content table { - border-spacing: 0 5px; - border-collapse: separate; -} -.content td { vertical-align: top; } -.content td:first-child { padding-right: 20px; } -.content td p:first-child { margin-top: 0; } -.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; } - -.docblock table { - border: 1px solid; - margin: .5em 0; - border-collapse: collapse; - width: 100%; -} - -.docblock table td { - padding: .5em; - border-top: 1px dashed; - border-bottom: 1px dashed; -} - -.docblock table th { - padding: .5em; - text-align: left; - border-top: 1px solid; - border-bottom: 1px solid; -} - -.content .item-list { - list-style-type: none; - padding: 0; -} - -.content .item-list li { margin-bottom: 3px; } - -.content .multi-column { - -moz-column-count: 5; - -moz-column-gap: 2.5em; - -webkit-column-count: 5; - -webkit-column-gap: 2.5em; - column-count: 5; - column-gap: 2.5em; -} -.content .multi-column li { width: 100%; display: inline-block; } - -.content .method { - font-size: 1em; - position: relative; -} -/* Shift "where ..." part of method or fn definition down a line */ -.content .method .where, .content .fn .where { display: block; } -/* Bit of whitespace to indent it */ -.content .method .where::before, .content .fn .where::before { content: ' '; } - -.content .methods > div { margin-left: 40px; } - -.content .impl-items .docblock, .content .impl-items .stability { - margin-left: 40px; -} -.content .impl-items .method, .content .impl-items > .type { - margin-left: 20px; -} - -.content .stability code { - font-size: 90%; -} - -nav { - border-bottom: 1px solid; - padding-bottom: 10px; - margin-bottom: 10px; -} -nav.main { - padding: 20px 0; - text-align: center; -} -nav.main .current { - border-top: 1px solid; - border-bottom: 1px solid; -} -nav.main .separator { - border: 1px solid; - display: inline-block; - height: 23px; - margin: 0 20px; -} -nav.sum { text-align: right; } -nav.sub form { display: inline; } - -nav.sub, .content { - margin-left: 230px; -} - -a { - text-decoration: none; - background: transparent; -} - -.docblock a:hover, .stability a { - text-decoration: underline; -} - -.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; } -.content span.struct, .content a.struct, .block a.current.struct { color: #df3600; } -.content a.type { color: #e57300; } -.content a.macro { color: #068000; } -.block a.current.crate { font-weight: 500; } - -.search-input { - width: 100%; - /* Override Normalize.css: we have margins and do - not want to overflow - the `moz` attribute is necessary - until Firefox 29, too early to drop at this point */ - -moz-box-sizing: border-box !important; - box-sizing: border-box !important; - outline: none; - border: none; - border-radius: 1px; - margin-top: 5px; - padding: 10px 16px; - font-size: 17px; - transition: border-color 300ms ease; - transition: border-radius 300ms ease-in-out; - transition: box-shadow 300ms ease-in-out; -} - -.search-input:focus { - border-color: #66afe9; - border-radius: 2px; - border: 0; - outline: 0; - box-shadow: 0 0 8px #078dd8; -} - -.search-results .desc { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - display: block; -} - -.search-results a { - display: block; -} - -.content .search-results td:first-child { padding-right: 0; } -.content .search-results td:first-child a { padding-right: 10px; } - -tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; } - -body.blur > :not(#help) { - filter: blur(8px); - -webkit-filter: blur(8px); - opacity: .7; -} - -#help { - width: 100%; - height: 100vh; - position: fixed; - top: 0; - left: 0; - display: flex; - justify-content: center; - align-items: center; -} -#help > div { - flex: 0 0 auto; - background: #e9e9e9; - box-shadow: 0 0 6px rgba(0,0,0,.2); - width: 550px; - height: 330px; - border: 1px solid #bfbfbf; -} -#help dt { - float: left; - border-radius: 4px; - border: 1px solid #bfbfbf; - background: #fff; - width: 23px; - text-align: center; - clear: left; - display: block; - margin-top: -1px; -} -#help dd { margin: 5px 33px; } -#help .infos { padding-left: 0; } -#help h1, #help h2 { margin-top: 0; } -#help > div div { - width: 50%; - float: left; - padding: 20px; -} - -em.stab { - display: inline-block; - border-width: 1px; - border-style: solid; - padding: 3px; - margin-bottom: 5px; - font-size: 90%; - font-style: normal; -} -em.stab p { - display: inline; -} - -.module-item .stab { - border-width: 0; - padding: 0; - margin: 0; - background: inherit !important; -} - -.module-item.unstable { - opacity: 0.65; -} - -.since { - font-weight: normal; - font-size: initial; - color: grey; - position: absolute; - right: 0; - top: 0; -} - -.variants_table { - width: 100%; -} - -.variants_table tbody tr td:first-child { - width: 1%; /* make the variant name as small as possible */ -} - -td.summary-column { - width: 100%; -} - -.summary { - padding-right: 0px; -} - -.line-numbers :target { background-color: transparent; } - -/* Code highlighting */ -pre.rust .kw { color: #8959A8; } -pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; } -pre.rust .number, pre.rust .string { color: #718C00; } -pre.rust .self, pre.rust .boolval, pre.rust .prelude-val, -pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; } -pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } -pre.rust .lifetime { color: #B76514; } - -.rusttest { display: none; } -pre.rust { position: relative; } -a.test-arrow { - display: inline-block; - position: absolute; - background-color: #4e8bca; - padding: 5px 10px 5px 10px; - border-radius: 5px; - font-size: 130%; - top: 5px; - right: 5px; -} - -.methods .section-header { - /* Override parent class attributes. */ - border-bottom: none !important; - font-size: 1.1em !important; - margin: 0 0 -5px; - padding: 0; -} - -.section-header:hover a:after { - content: '\2002\00a7\2002'; -} - -.section-header:hover a { - text-decoration: none; -} - -.section-header a { - color: inherit; -} - -.collapse-toggle { - font-weight: 300; - position: absolute; - left: -23px; - color: #999; - top: 0; -} - -.toggle-wrapper > .collapse-toggle { - left: -24px; - margin-top: 0px; -} - -.toggle-wrapper { - position: relative; -} - -.toggle-wrapper.collapsed { - height: 1em; - transition: height .2s; -} - -.collapse-toggle > .inner { - display: inline-block; - width: 1.2ch; - text-align: center; -} - -.toggle-label { - color: #999; -} - -.ghost { - display: none; -} - -.ghost + .since { - position: initial; - display: table-cell; -} - -.since + .srclink { - display: table-cell; - padding-left: 10px; -} - -span.since { - position: initial; - font-size: 20px; - margin-right: 5px; -} - -:target > code { - background: #FDFFD3; -} - -/* Media Queries */ - -@media (max-width: 700px) { - body { - padding-top: 0px; - } - - .sidebar { - height: 40px; - min-height: 40px; - width: 100%; - margin: 0px; - padding: 0px; - position: static; - } - - .sidebar .location { - float: right; - margin: 0px; - padding: 3px 10px 1px 10px; - min-height: 39px; - background: inherit; - text-align: left; - font-size: 24px; - } - - .sidebar .location:empty { - padding: 0; - } - - .sidebar img { - width: 35px; - margin-top: 5px; - margin-bottom: 0px; - float: left; - } - - nav.sub { - margin: 0 auto; - } - - .sidebar .block { - display: none; - } - - .content { - margin-left: 0px; - } - - .content .in-band { - width: 100%; - } - - .content .out-of-band { - display: none; - } - - .toggle-wrapper > .collapse-toggle { - left: 0px; - } - - .toggle-wrapper { - height: 1.5em; - } -} - -@media print { - nav.sub, .content .out-of-band, .collapse-toggle { - display: none; - } -} diff --git a/css/settings-20191010-1.40.0-nightly-898f36c83.js b/css/settings-20191010-1.40.0-nightly-898f36c83.js deleted file mode 100644 index 993030905..000000000 --- a/css/settings-20191010-1.40.0-nightly-898f36c83.js +++ /dev/null @@ -1 +0,0 @@ -(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled)}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName)}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return}for(var i=0;i"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild)} \ No newline at end of file diff --git a/css/storage-20191010-1.40.0-nightly-898f36c83.js b/css/storage-20191010-1.40.0-nightly-898f36c83.js deleted file mode 100644 index b7d44a868..000000000 --- a/css/storage-20191010-1.40.0-nightly-898f36c83.js +++ /dev/null @@ -1 +0,0 @@ -var resourcesSuffix="-20191010-1.40.0-nightly-898f36c83";var currentTheme=document.getElementById("themeStyle");var mainTheme=document.getElementById("mainThemeStyle");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function isHidden(elem){return elem.offsetParent===null}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;if(reversed!==true){for(var i=0;i=0;--i){if(func(arr[i])===true){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function usableLocalStorage(){if(typeof Storage==="undefined"){return false}try{return window.localStorage!==null&&window.localStorage!==undefined}catch(err){return false}}function updateLocalStorage(name,value){if(usableLocalStorage()){localStorage[name]=value}else{}}function getCurrentValue(name){if(usableLocalStorage()&&localStorage[name]!==undefined){return localStorage[name]}return null}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){var fullBasicCss="rustdoc"+resourcesSuffix+".css";var fullNewTheme=newTheme+resourcesSuffix+".css";var newHref=mainStyleElem.href.replace(fullBasicCss,fullNewTheme);if(styleElem.href===newHref){return}var found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),function(el){savedHref.push(el.href)})}onEach(savedHref,function(el){if(el===newHref){found=true;return true}});if(found===true){styleElem.href=newHref;if(saveTheme===true){updateLocalStorage("rustdoc-theme",newTheme)}}}function getSystemValue(){var property=getComputedStyle(document.documentElement).getPropertyValue('content');return property.replace(/[\"\']/g,"")}switchTheme(currentTheme,mainTheme,getCurrentValue("rustdoc-theme")||getSystemValue()||"light",false) \ No newline at end of file diff --git a/css/style.css b/css/style.css deleted file mode 100644 index 655d26b92..000000000 --- a/css/style.css +++ /dev/null @@ -1,626 +0,0 @@ -html, button, input, select, textarea, -.pure-g [class*="pure-u"] { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #000; -} - -.pure-button-normal { - background-color: #fff; - box-sizing: border-box !important; - border: 1px solid #ddd; -} - -.description { - font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif; -} - -div.rustdoc { - font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif; - padding: 10px 15px 20px 15px; - position: fixed; - top: 32px; - bottom: 0; - left: 0; - right: 0; - display: block; - overflow-y: auto; -} -@media (max-width: 700px) { - div.rustdoc { - padding-top: 0; - } -} -@media (min-width: 701px) { - div.rustdoc .sidebar { - margin-top: 32px; - } -} -div.rustdoc .sidebar .block > ul > li { - margin-right: -10px; -} -div.rustdoc #source-sidebar { - top: 32px; -} -div.rustdoc #sidebar-toggle { - top: 62px; -} -@media (max-width: 700px) { - div.rustdoc .sidebar.mobile { - top: 32px; - } - div.rustdoc .sidebar.mobile .sidebar-elems.show-it { - top: 77px; - } - div.rustdoc .sidebar.mobile #sidebar-filler { - top: 32px; - } -} - -body { - padding: 0; - margin: 0; - padding-top: 32px; -} - -body.blur > :not(#help) { - filter: none; - -webkit-filter: none; -} - -body.blur > div.nav-container > *, -body.blur > div.cratesfyi-package-container > *, -body.blur > div.rustdoc > :not(#help) { - filter: blur(8px); - -webkit-filter: blur(8px); - opacity: .7; -} - -body { - text-align: center; - font: 16px/1.4 "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - -pre { - font-size: 0.9rem; - overflow: auto; - white-space: pre; -} - -div.container { - max-width: 1160px; - margin: 0 auto; - text-align: left; -} - -div.container-rustdoc { - text-align: left; -} - -div.nav-container { - z-index: 999; - height: 32px; - border-bottom: 1px solid #ddd; - background-color: #fff; - left: 0; - right: 0; - top: 0; - position: fixed; -} -div.nav-container li { - border-left: 1px solid #ddd; -} -div.nav-container .pure-menu-has-children > .pure-menu-link:after { - font-size: 0.8em; -} -div.nav-container a { - font-size: 0.8em; - font-weight: 400; -} -div.nav-container .pure-menu-link:hover { - color: #000; - background-color: inherit; -} -div.nav-container form.landing-search-form-nav { - max-width: 1200px; -} -div.nav-container form.landing-search-form-nav input.search-input-nav { - float: right; - max-width: 200px; - border: none; - margin: 0 1em 0 0; - font-size: 0.8em; - text-align: right; - box-shadow: none; - background-color: #fff; - height: 31px; - display: none; -} -@media screen and (min-width: 35.5em) { - div.nav-container form.landing-search-form-nav input.search-input-nav { - display: block; - } -} -div.nav-container form.landing-search-form-nav input.search-input-nav:focus { - outline: unset; -} -div.nav-container .pure-menu-children { - border: 1px solid #ddd; - border-radius: 0 0 2px 2px; - margin-left: -1px; -} -div.nav-container .pure-menu-children li { - border-left: none; -} -div.nav-container .warn { - color: #e57300; -} -div.nav-container .warn:hover { - color: #b25900; -} -div.nav-container .error { - color: #d93d3d; -} -div.nav-container .error:hover { - color: #be2525; -} -div.nav-container div.rustdoc-navigation span.title { - display: none; -} -@media screen and (min-width: 35.5em) { - div.nav-container div.rustdoc-navigation span.title { - display: inline; - } -} -div.nav-container div.rustdoc-navigation div.package-details-menu { - width: 350px; -} -div.nav-container div.rustdoc-navigation div.package-details-menu p.description { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 0.8em; - color: #777; - padding: .5em 1em; - margin: 0; -} -div.nav-container div.rustdoc-navigation div.package-details-menu ul.pure-menu-list { - width: 100%; -} -div.nav-container div.rustdoc-navigation div.package-details-menu div.right-border { - border-right: 1px solid #ddd; -} -div.nav-container div.rustdoc-navigation div.package-details-menu a.pure-menu-link { - word-wrap: normal; - white-space: normal; -} -div.nav-container div.rustdoc-navigation div.package-details-menu div.sub-menu { - max-height: 150px; - overflow-y: auto; -} -div.nav-container div.rustdoc-navigation div.package-details-menu div.sub-menu ul.pure-menu-list { - border-top: none; -} -div.nav-container div.rustdoc-navigation div.package-details-menu div.sub-menu li.pure-menu-item:last-child { - border-bottom: none; -} - -div.nav-container-rustdoc { - position: fixed; - left: 0; - right: 0; - top: 0; - z-index: 999; -} - -div.landing { - text-align: center; - padding-top: 30px; - padding-bottom: 60px; -} -div.landing h1.brand { - font-size: 3em; - margin-bottom: 10px; -} -div.landing form.landing-search-form { - max-width: 500px; - margin: 0 auto; - padding: .4em 1em; -} -div.landing form.landing-search-form div.buttons { - margin-top: 30px; -} - -div.recent-releases-container { - text-align: left; - margin-bottom: 50px; -} -div.recent-releases-container ul, div.recent-releases-container li { - list-style-type: none; - margin: 0; - padding: 0; -} -div.recent-releases-container ol.queue-list li { - list-style-type: decimal; - margin-left: 20px; -} -div.recent-releases-container ol.queue-list li a { - color: #4d76ae; -} -div.recent-releases-container strong { - font-weight: 500; -} -div.recent-releases-container pre { - white-space: pre-wrap; -} -div.recent-releases-container .release { - display: block; - border-bottom: 1px solid #ddd; - padding: .4em 1em; -} -@media screen and (min-width: 64em) { - div.recent-releases-container .release { - padding: .4em 0; - margin: 0 1em; - } -} -div.recent-releases-container .release:hover, div.recent-releases-container li.selected > .release { - background-color: #F5F5F5; -} -div.recent-releases-container li:last-child .release { - border-bottom: none; -} -div.recent-releases-container .name { - color: #4d76ae; - font-weight: 500; - white-space: nowrap; -} -@media screen and (min-width: 35.5em) { - div.recent-releases-container .name { - text-overflow: ellipsis; - overflow: hidden; - } -} -div.recent-releases-container .name:hover { - overflow: visible; - white-space: normal; -} -div.recent-releases-container .build { - font-weight: 500; -} -div.recent-releases-container .build i.fa-check { - color: #068000; -} -div.recent-releases-container .build i.fa-close { - color: #df3600; -} -div.recent-releases-container .description { - font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif; - font-weight: normal; -} -@media screen and (min-width: 35.5em) { - div.recent-releases-container .description { - font-size: 1em; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} -@media screen and (min-width: 35.5em) { - div.recent-releases-container .description:hover { - overflow: visible; - white-space: normal; - } -} -div.recent-releases-container .date { - font-weight: normal; -} -@media screen and (min-width: 35.5em) { - div.recent-releases-container .date { - text-align: right; - } -} -div.recent-releases-container div.pagination { - text-align: center; - margin: 1em; -} -div.recent-releases-container div.pagination .pure-button { - margin: 0; -} - -div.package-container { - background-color: #4d76ae; - color: #F5F5F5; -} -div.package-container h1 { - margin: 0; - padding: 20px 0 0 16px; -} -div.package-container p { - margin: 0; - padding: 0 0 20px 16px; -} -div.package-container .pure-menu .pure-menu-link { - background-color: #fff; - border-top: 1px solid #ddd; - border-left: 1px solid #ddd; - border-right: 1px solid #ddd; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 2px solid #ddd; - padding: .4em 1em; -} -div.package-container .pure-menu .pure-menu-active { - border-bottom: 2px solid #fff; - color: #000; -} -div.package-container .pure-menu .pure-menu-link:hover { - color: #000; -} - -div.package-sheet-container { - margin-top: 10px; - margin-bottom: 20px; -} -div.package-sheet-container .pure-menu-link { - border-radius: 4px; - padding: .2em .8em; - font-weight: 400; -} -div.package-sheet-container .build-success { - color: #068000; -} -div.package-sheet-container .build-fail { - color: #df3600; -} - -div.package-page-container div.package-menu { - padding: 0 10px; - margin-bottom: 50px; -} -div.package-page-container div.package-menu li.pure-menu-heading { - font-size: 1.3em; - color: #000; - font-weight: 500; - text-align: center; - border-bottom: 1px solid #eaeaea; - text-transform: none; - padding-bottom: 6px; - margin: 20px 5px 15px 5px; -} -div.package-page-container div.package-menu li.pure-menu-heading:first-child { - margin-top: 0; -} -div.package-page-container div.package-menu li i.fa { - display: inline-block; - width: 20px; -} -div.package-page-container div.package-menu a.pure-menu-link { - font-size: 14px; - color: #000; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - padding: 7px 8px; -} -div.package-page-container div.package-menu a.pure-menu-link:hover { - background-color: #F5F5F5; -} -div.package-page-container div.package-menu div.sub-menu { - max-height: 135px; - overflow-y: auto; -} -div.package-page-container div.package-menu div.sub-menu ul.pure-menu-list { - border-top: none; -} -div.package-page-container div.package-menu div.sub-menu li.pure-menu-item:last-child { - border-bottom: none; -} -div.package-page-container div.package-menu img.owner { - max-width: 32px; - max-height: 32px; - border-radius: 2px; -} - -div.package-page-container div.package-details { - padding: 0 1em; - font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif; -} -div.package-page-container div.package-details a { - color: #4d76ae; -} -div.package-page-container div.package-details a:hover { - text-decoration: underline; -} -div.package-page-container div.package-details h1, div.package-page-container div.package-details h2, div.package-page-container div.package-details h3, div.package-page-container div.package-details h4, div.package-page-container div.package-details h5, div.package-page-container div.package-details h6 { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; -} -div.package-page-container div.package-details h1:first-child, -div.package-page-container div.package-details h2:first-child, -div.package-page-container div.package-details h3:first-child, -div.package-page-container div.package-details h4:first-child, -div.package-page-container div.package-details h5:first-child, -div.package-page-container div.package-details h6:first-child { - margin-top: 0; -} -div.package-page-container div.package-details table { - border-collapse: collapse; - border-spacing: 0; - empty-cells: show; - border: 1px solid #cbcbcb; - margin-bottom: 15px; -} -div.package-page-container div.package-details table td, div.package-page-container div.package-details table th { - border-left: 1px solid #cbcbcb; - border-width: 0 0 0 1px; - font-size: inherit; - margin: 0; - overflow: visible; - padding: 0.5em 1em; -} -div.package-page-container div.package-details table th { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 500; -} -div.package-page-container div.package-details table td { - border-bottom: 1px solid #cbcbcb; -} -div.package-page-container div.package-details table tbody > tr:last-child > td { - border-bottom-width: 0; -} -div.package-page-container div.package-details table thead { - background-color: #e0e0e0; - color: #000; - text-align: left; - vertical-align: bottom; -} - -div.package-page-container pre { - background-color: inherit; - padding: 0; -} -div.package-page-container pre code { - white-space: pre; -} - -div.cratesfyi-package-container { - text-align: left; - background-color: #F5F5F5; - border-bottom: 1px solid #ddd; - margin-bottom: 20px; -} -div.cratesfyi-package-container h1 { - margin: 0; - padding: 15px 0 0 14px; -} -div.cratesfyi-package-container div.description { - font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif; - margin: 0; - padding: 0 0 15px 14px; -} -@media screen and (min-width: 35.5em) { - div.cratesfyi-package-container div.description { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} -div.cratesfyi-package-container div.description-in-rustdoc { - padding: 10px 0 10px 14px; -} -div.cratesfyi-package-container .pure-menu { - margin-bottom: -1px; - padding-left: 14px; -} -div.cratesfyi-package-container .pure-menu .pure-menu-link { - color: #666; - font-size: 14px; - padding: .4em 1em .3em 1em; -} -div.cratesfyi-package-container .pure-menu .pure-menu-link .title { - display: none; -} -@media screen and (min-width: 35.5em) { - div.cratesfyi-package-container .pure-menu .pure-menu-link .title { - display: inline; - } -} -div.cratesfyi-package-container .pure-menu .pure-menu-active { - color: #000; - background-color: #fff; - border-top: 1px solid #ddd; - border-left: 1px solid #ddd; - border-right: 1px solid #ddd; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 2px solid #fff; -} -div.cratesfyi-package-container .pure-menu .pure-menu-active:hover { - background-color: #fff !important; -} -div.cratesfyi-package-container .pure-menu .pure-menu-link:hover { - color: #000; - background-color: inherit; -} -div.cratesfyi-package-container ul.platforms-menu { - float: right; - display: none; -} -div.cratesfyi-package-container ul.platforms-menu ul.pure-menu-children { - left: auto; - right: 0; - border: 1px solid #ddd; - border-radius: 2px; -} -div.cratesfyi-package-container ul.platforms-menu .pure-menu-has-children > .pure-menu-link:after { - font-size: 14px; -} -@media screen and (min-width: 35.5em) { - div.cratesfyi-package-container ul.platforms-menu { - display: inline-block; - } -} - -div.cratesfyi-package-container-rustdoc { - margin-bottom: 10px; -} - -div.warning { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - border-radius: 4px; - background-color: #ffe5cc; - padding: .4em 1em; - text-align: center; - margin-bottom: 10px; -} -div.warning a { - color: #4d76ae; - text-decoration: underline; -} - -div.search-page-search-form { - padding: .4em 1em; - text-align: center; -} -div.search-page-search-form input.search-input { - display: inline-block; - max-width: 300px; - padding: .4em 1em; -} - -.menu-item-divided { - border-bottom: 1px solid #ddd; -} - -.rust-navigation-item { - background: url(/rust-logo.png) no-repeat; - background-position: 15px 45%; - background-size: 12px; - padding-left: 35px; -} - -.about { - font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif; - padding: .4em 1em; -} -.about a { - color: #4d76ae; -} -.about a:hover { - text-decoration: underline; -} -.about table { - margin-bottom: 10px; -} -.about thead tr th { - font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 500; -} -.about strong { - font-weight: bold; -} -.about pre code { - background-color: inherit; -} - -i.dependencies.normal { - visibility: hidden; - display: none; -} diff --git a/css/theme-20191010-1.40.0-nightly-898f36c83.js b/css/theme-20191010-1.40.0-nightly-898f36c83.js deleted file mode 100644 index bc5f355ec..000000000 --- a/css/theme-20191010-1.40.0-nightly-898f36c83.js +++ /dev/null @@ -1,47 +0,0 @@ -var themes = document.getElementById("theme-choices"); -var themePicker = document.getElementById("theme-picker"); - -function showThemeButtonState() { - themes.style.display = "block"; - themePicker.style.borderBottomRightRadius = "0"; - themePicker.style.borderBottomLeftRadius = "0"; -} - -function hideThemeButtonState() { - themes.style.display = "none"; - themePicker.style.borderBottomRightRadius = "3px"; - themePicker.style.borderBottomLeftRadius = "3px"; -} - -function switchThemeButtonState() { - if (themes.style.display === "block") { - hideThemeButtonState(); - } else { - showThemeButtonState(); - } -}; - -function handleThemeButtonsBlur(e) { - var active = document.activeElement; - var related = e.relatedTarget; - - if (active.id !== "themePicker" && - (!active.parentNode || active.parentNode.id !== "theme-choices") && - (!related || - (related.id !== "themePicker" && - (!related.parentNode || related.parentNode.id !== "theme-choices")))) { - hideThemeButtonState(); - } -} - -themePicker.onclick = switchThemeButtonState; -themePicker.onblur = handleThemeButtonsBlur; -["dark","light"].forEach(function(item) { - var but = document.createElement('button'); - but.innerHTML = item; - but.onclick = function(el) { - switchTheme(currentTheme, mainTheme, item, true); - }; - but.onblur = handleThemeButtonsBlur; - themes.appendChild(but); -}); \ No newline at end of file diff --git a/css/wheel-20191010-1.40.0-nightly-898f36c83.svg b/css/wheel-20191010-1.40.0-nightly-898f36c83.svg deleted file mode 100644 index 44381a401..000000000 --- a/css/wheel-20191010-1.40.0-nightly-898f36c83.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 14105ff86..6a092391d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -36,4 +36,6 @@ if ! [ -d "${CRATESFYI_PREFIX}/crates.io-index/.git" ]; then git --git-dir="$CRATESFYI_PREFIX/crates.io-index/.git" branch crates-index-diff_last-seen fi +cratesfyi build add-essential-files --only-first-time + cratesfyi "$@" diff --git a/src/bin/cratesfyi.rs b/src/bin/cratesfyi.rs index fd8439ead..1d100ba13 100644 --- a/src/bin/cratesfyi.rs +++ b/src/bin/cratesfyi.rs @@ -66,7 +66,10 @@ pub fn main() { .conflicts_with_all(&["CRATE_NAME", "CRATE_VERSION"]) .help("Build a crate at a specific path"))) .subcommand(SubCommand::with_name("add-essential-files") - .about("Adds essential files for rustc")) + .about("Adds essential files for rustc") + .arg(Arg::with_name("ONLY_FIRST_TIME") + .long("only-first-time") + .help("add essential files only if no essential files are present"))) .subcommand(SubCommand::with_name("lock").about("Locks cratesfyi daemon to stop \ building new crates")) .subcommand(SubCommand::with_name("unlock") @@ -168,7 +171,16 @@ pub fn main() { matches.value_of("CRATE_NAME").unwrap(), matches.value_of("CRATE_VERSION").unwrap(), None), }.expect("Building documentation failed"); docbuilder.save_cache().expect("Failed to save cache"); - } else if let Some(_) = matches.subcommand_matches("add-essential-files") { + } else if let Some(m) = matches.subcommand_matches("add-essential-files") { + if m.is_present("ONLY_FIRST_TIME") { + let conn = db::connect_db().unwrap(); + let res = conn.query("SELECT * FROM config WHERE name = 'rustc_version';", &[]).unwrap(); + if !res.is_empty() { + println!("add-essential files was already called in the past, exiting"); + return; + } + } + let mut builder = RustwideBuilder::init().unwrap(); builder.add_essential_files().expect("failed to add essential files"); } else if let Some(_) = matches.subcommand_matches("lock") { diff --git a/src/web/page.rs b/src/web/page.rs index d7d081355..2f8289df4 100644 --- a/src/web/page.rs +++ b/src/web/page.rs @@ -6,6 +6,27 @@ use iron::{IronResult, Set, status}; use iron::response::Response; use handlebars_iron::Template; +lazy_static! { + static ref RUSTC_RESOURCE_SUFFIX: String = load_rustc_resource_suffix() + .unwrap_or_else(|_| "???".into()); +} + +fn load_rustc_resource_suffix() -> Result { + let conn = crate::db::connect_db()?; + + let res = conn.query("SELECT value FROM config WHERE name = 'rustc_version';", &[])?; + if res.is_empty() { + failure::bail!("missing rustc version"); + } + + if let Some(Ok(vers)) = res.get(0).get_opt::<_, Json>("value") { + if let Some(vers_str) = vers.as_string() { + return Ok(crate::utils::parse_rustc_version(vers_str)?); + } + } + + failure::bail!("failed to parse the rustc version"); +} pub(crate) struct GlobalAlert { pub(crate) url: &'static str, @@ -33,6 +54,7 @@ pub struct Page { varss: BTreeMap, varsb: BTreeMap, varsi: BTreeMap, + rustc_resource_suffix: &'static str, } @@ -45,6 +67,7 @@ impl Page { varss: BTreeMap::new(), varsb: BTreeMap::new(), varsi: BTreeMap::new(), + rustc_resource_suffix: &RUSTC_RESOURCE_SUFFIX, } } @@ -114,6 +137,7 @@ impl ToJson for Page { } tree.insert("content".to_owned(), self.content.to_json()); + tree.insert("rustc_resource_suffix".to_owned(), self.rustc_resource_suffix.to_json()); tree.insert("cratesfyi_version".to_owned(), ::BUILD_VERSION.to_json()); tree.insert("cratesfyi_version_safe".to_owned(), ::BUILD_VERSION.replace(" ", "-").replace("(", "").replace(")", "").to_json()); diff --git a/css/favicon.ico b/static/favicon.ico similarity index 100% rename from css/favicon.ico rename to static/favicon.ico diff --git a/templates/header.hbs b/templates/header.hbs index eea0c851d..d1a001cfd 100644 --- a/templates/header.hbs +++ b/templates/header.hbs @@ -7,8 +7,9 @@ - - + + + {{#if varsb.javascript_highlightjs}} diff --git a/templates/style.scss b/templates/style.scss index ab930b01b..b4382edcc 100644 --- a/templates/style.scss +++ b/templates/style.scss @@ -86,11 +86,13 @@ div.rustdoc { } // this is actual fix for docs.rs navigation and rustdoc sidebar - position: absolute; + position: fixed; + top: $top-navbar-height; + bottom: 0; left: 0; right: 0; - top: $top-navbar-height; - max-height: calc(100vh - #{$top-navbar-height}); + display: block; + overflow-y: auto; } body { @@ -297,6 +299,10 @@ div.landing { margin-top: 30px; } } + + input#search { + margin: 0; + } } div.recent-releases-container { @@ -349,6 +355,15 @@ div.recent-releases-container { color: $color-url; font-weight: 500; white-space: nowrap; + margin: 0; + + &:hover { + background-color: transparent; + } + + &::before { + display: none; + } @media #{$media-sm} { text-overflow: ellipsis; @@ -407,6 +422,10 @@ div.recent-releases-container { margin: 0; } } + + h4 { + border-bottom-color: $color-border !important; + } } div.package-container { @@ -750,6 +769,10 @@ div.search-page-search-form { pre code { background-color: inherit; } + + h4 { + border-bottom-color: $color-border !important; + } } i.dependencies.normal {