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: simplify JS search routine by not messing with lev distance #105796

Merged

Commits on Jan 14, 2023

  1. rustdoc: simplify JS search routine by not messing with lev distance

    Since the sorting function accounts for an `index` field, there's not much
    reason to also be applying changes to the levenshtein distance. Instead,
    we can just not treat `lev` as a filter if there's already a non-sentinel
    value for `index`.
    
    This change gives slightly more weight to the index and path part, as
    search criteria, than it used to. This changes some of the test cases,
    but not in any obviously-"worse" way, and, in particular, substring matches
    are a bigger deal than levenshtein distances (we're assuming that a typo
    is less likely than someone just not typing the entire name).
    
    Based on
    rust-lang#103710 (comment)
    notriddle committed Jan 14, 2023
    Copy the full SHA
    59ba74c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    db558b4 View commit details
    Browse the repository at this point in the history