-
Notifications
You must be signed in to change notification settings - Fork 212
Remove unnecessary redirect #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here's some half-working code (goes in let target_links = {
use std::collections::HashMap;
let mut map = HashMap::new();
for target in &crate_details.doc_targets {
match target {
Json::String(target) => {
if target == &crate_details.metadata.default_target {
map.insert(target, "".to_owned());
} else {
let path = format!("/{}", target);
map.insert(target, path);
}
}
_ => log::warn!("unknown JSON type for doc_target: {}", target),
}
}
map
}; |
To implement this:
|
I'll take a look at this, thanks for all the work outlining what needs to be done. Is double clicking on the platform drop down supposed to automatically redirect you? Right now it does not. |
I wouldn't expect it too ... you're suggesting it should take you to the default platform? I'd be ok with that. |
@jyn514 I think I assumed a bit too much when glancing over the issue :). I don't have a preference either way, but I'll add it as part of this PR and we can get opinions from the larger team. |
@pietroalbini do you think this is still worth fixing? I kind of like that it's consistent with all the other redirects, it makes it easier to reason about reading the code. |
Once #534 gets merged, the 'Platform' dropdown will link to the default build /:crate/:version/:platform, which will immediately redirect to /:crate/:version. It would be nice to link to /:crate/:version directly for the default platform.
The text was updated successfully, but these errors were encountered: