I've implemented a few new things on lib.rs recently!
New features page
It lists all cargo features that a crate supports. It includes comments from Cargo.toml
, neatly formatted as markdown, so you can learn what the features do.
Since comments on features are rare, I also search crate's source code for uses of cfg(feature = "…")
to give a hint what functions or types are affected by the feature.
Cargo has this quirk that all optional dependencies implicitly create features, unless you use a new features syntax with dep:
or ?
. Most people probably don't realize crates "leaking" like that into features, so the features page shows when that happens.
- Feature flags of quick-xml crate // Lib.rs
- Feature flags of serde_with crate // Lib.rs
- Feature flags of gifski crate // Lib.rs
You can open the new features page by clicking any feature name or [optional]
label in the sidebar under Dependencies (I know, these are tiny tiny links…)
Cargo vet integration
The site shows "Audit" link for crates that have cargo-crev reviews. Now that page also contains cargo-vet reviews from Google and Mozilla, as well as any unpatched rustsec advisories.
Smaller improvements
Fixed handling of crates with multiple versions of the same dependency (package
aliases). I wrote the original dependency resolution code before Cargo had this feature!
Maintenance status labels
I used to conflate concepts of deprecated, unmaintained, and generally not recommended crates. This has caused some stir (that I will not further comment on). Now there is a alternative label for crates with an archived repo, and an explicit unmaintained flag read from cargo-crev or rustsec.
Some fixes for renamed github logins
Unfortunately, a github login is not a permanent identifier. People change their account names. There is a permanent github numeric ID, but it's not possible to just get an up-to-date login for an ID (GitHub blocked that, probably due to account enumeration issues). So I've added quite a bit of guesswork and fallbacks to recover renamed accounts. It might need more work still.
Markdown rendering improvements
I've hacked support for Rustdoc's URLs like [`crate::ident`]
in Markdown. There's also improved auto-detection of markdown vs plaintext for ambiguous fields like crates' descriptions.
Category and keyword guessing improvements
If you publish crates, you should fill in the keywords
and categories
fields. But majority of crates lack these fields! For crates that don't have keywords, keywords used to be guessed from the README. Now they're also guessed based on source code identifiers and doc comments. I've also expanded list of keyword synonyms (the search will show "did you mean [better synonym]?").
With improved keywords, I now added guessing of more than one category for a crate (e.g. a parser for genome data can be in both parsers and biology).
Disclaimers
I've documented ways in which lib.rs combines and guesses information: Data processing // Lib.rs
Precise repo link
On crate pages the link to their Github repositories is subtly split in two parts. First half links to the root of the repository, the second half links to exact commit and directory where the crate is located (if that is known). This makes it easier to find crates in monorepos.
Also if the Cargo.toml
file doesn't specify any repository
URL, I now search owner's Github account for a repository with that crate.
Merged reverse deps
Some crates have lots of versions, and their version popularity chart was getting long. I now group least used versions together.
Index reload is quicker
The site used to check for new crates every hour. Now it's every 15 minutes, and flushes caches more often.