mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 23:57:07 +00:00
Fix crate searcher version cache
This commit is contained in:
parent
903dda4123
commit
994b589b80
1 changed files with 3 additions and 1 deletions
|
@ -3,8 +3,9 @@ class SingleCrateDocSearch extends DocSearch {
|
|||
|
||||
constructor(name, version, searchIndex) {
|
||||
super(name, searchIndex, () => {
|
||||
return `https://docs.rs/${name}/${version}/`;
|
||||
return `https://docs.rs/${name}/${this.version}/`;
|
||||
});
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +32,7 @@ class CrateDocSearch {
|
|||
let searcher = null;
|
||||
if (this.cachedCrateSearcher?.name === crateName) {
|
||||
searcher = this.cachedCrateSearcher;
|
||||
searcher.version = await settings.keepCratesUpToDate ? "latest" : searcher.version;
|
||||
} else {
|
||||
let crate = await CrateDocManager.getCrateByName(crateName);
|
||||
if (crate) {
|
||||
|
|
Loading…
Reference in a new issue