Closed
Description
theme.js is loaded very early in the rustdoc HTML documents, "to reduce theme switch latencies as much as possible:" https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/render/mod.rs#L782-L834. It seems when themes were first introduced in 003b2bc, theme.js was responsible for setting the displayed theme based on local storage. However, since 5f93159, that job is done by storage.js and theme.js is mainly responsible for setting handlers on the UI elements used to pick themes.
I think it's possible now to incorporate theme.js into main.js and reduce the number of fetches per page by 1. @GuillaumeGomez what do you think?