-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Description
Boilerplate
Some (but not all) search result snippets for rust items include the boilerplate "1.0.0[−][src]". Example screenshots below are linked to the Google search results page they are taken from.
Search results for "rust slice" show the boilerplate:

Search results for "rust slice" omit the boilerplate:

Per https://developers.google.com/search/docs/advanced/appearance/good-titles-snippets and https://developers.google.com/search/docs/advanced/crawling/special-tags#data-nosnippet, we can wrap this particular piece of boilerplate in <span data-nosnippet> to omit it from snippets.
Low-information meta descriptions
Also, search engines commonly make snippets from the <meta name="description" value="..."> tag. The tag rustdoc currently generates is very low-information. For instance:
API documentation for the Rust
slicemod in cratestd
API documentation for the Rust
Errortrait in cratestd.
It would be much better to fill this tag with the first sentence (or two) of actual documentation. For instance:
A dynamically-sized view into a contiguous sequence, [T]. Slices are a view into a block of memory represented as a pointer and a length.
Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>.