Skip to content
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

rustdoc: remove link on slice brackets #98069

Merged
merged 1 commit into from
Jun 14, 2022

Commits on Jun 13, 2022

  1. rustdoc: remove link on slice brackets

    Since rust-lang#97668 was merged, the slice::get function now looks like this:
    
    ![image](https://user-images.githubusercontent.com/1593513/173430685-1dd2b275-2439-4392-b7d4-96bcb355a377.png)
    
    That whole thing, `[T]`, is a single link to `primitive.slice.html`. This
    definitely fixes it for this case, but it's not obvious what we should do for
    slices of concrete types:
    
    ![image](https://user-images.githubusercontent.com/1593513/173430968-7eed1aec-b688-4f84-a492-9210aff0037a.png)
    
    There are actually three links in that `[u8]`: the opening brace `[` is a
    link to `primitive.slice.html`, the `u8` is a link to `primitive.u8.html`,
    and the final `]` is a link to `primitive.slice.html`. This is a serious
    [usability bug](https://usability.yale.edu/web-accessibility/articles/links):
    the square braces are much too small for anyone who doesn't have perfect
    motor control using mouse or touch, provide an excessive number of tab stops
    for anyone using keyboard, and no visual indication whatsoever that they're
    separate links.
    
    Now that slices of generic types are linked, it seems reasonable to err on
    the side of less clutter and stop linking concrete slices to the slice page.
    notriddle committed Jun 13, 2022
    Configuration menu
    Copy the full SHA
    682889f View commit details
    Browse the repository at this point in the history