Improve names and types in Rust stdlib scraper #2596
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #2569, addressing issues with the standard library scraper I mentioned here.
There are two main fixes:
Names: all pages except for modules' index pages ignored what module they were from, and were just prepended with
std::
. This meant there were 13 pages namedstd::Iter
, about structs namedIter
from different modules. It also meant that things outside modules, e.g. primitive types, were prefixed withstd::
, naming the page onbool
asstd::bool
, although it can't be referenced that way in code. This also means that there are two pages namedstd::char
- one for the module, and one for the primitive typechar
.This prefixes everything in a module with that module's path, and does not prefix primitives. It also includes submodules in the path.
For example:
Types: almost everything was filed in
std
, with the exception of modules' index pages and primitive types. This meant there were over 30,000 pages in thestd
type, and many types for modules with only one page in them.This creates types for each module which include all submodules, and files anything not in a module, e.g. primitive types, in
std
.For example:
Or, in screenshots – before:
and after: