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

fix clippy lints and other minor improvements #688

Merged
merged 19 commits into from
Aug 8, 2024

Commits on Jul 24, 2024

  1. fix incorrect test that fails to compare lists

    A test tries to compare equality of `Vec`s, approximately `x.sort() == y.sort()`,
    but `sort()` uses in-place mutation, and returns `unit`, not the input `slice`,
    so the lists are never actually compared.
    abysssol committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    da632b4 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. switch from filter_map() to map_while()

    It's possible for a call to `File::open()` to succeed even if reading from
    that `File` isn't actually possible due to the `File` being a directory.
    In such cases, `Lines` can return `Err` infinitely,
    causing `filter_map()` to diverge while searching for a nonexistant `Ok`.
    
    This is a semantic change.
    `filter_map()` can filter multiple errors before returning lines again,
    while `map_while()` will stop iterating entirely at the first `Err`.
    
    However, errors are unlikely at all since the `file` argument is currently
    always a preallocated temporary file for collecting `Command` output.
    This merely mitigates the worst case if `lines_from_file()` is ever used
    in a way where this error could occur.
    abysssol committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    9925e49 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0ead872 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa0bc6c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5c5ee75 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e58f010 View commit details
    Browse the repository at this point in the history
  6. simplify iteration on map keys

    replace `Vec<String>` with `Vec<&str>` to reduce allocation
    abysssol committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    b5c5014 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7e09123 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fbd70e9 View commit details
    Browse the repository at this point in the history
  9. remove call to into_iter() on ranges

    all ranges are already iterators
    abysssol committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    05eaeac View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2b69046 View commit details
    Browse the repository at this point in the history
  11. remove write(true) from OpenOptions builder

    `append(true)` implies `write(true)`
    abysssol committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    5daa6b0 View commit details
    Browse the repository at this point in the history
  12. update edition to "2021"

    abysssol committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    91d0c27 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2024

  1. replace mixed quotes using backtick and singlequote with just backticks

    Why was this used in the first place? Does anyone depend on this particular format?
    abysssol committed Aug 5, 2024
    Configuration menu
    Copy the full SHA
    996587f View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. inline format symbols

    abysssol committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    6c22ee9 View commit details
    Browse the repository at this point in the history
  2. rename variables

    abysssol committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    b678b0d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34eb3ef View commit details
    Browse the repository at this point in the history
  4. replace String::from_utf8() with std::str::from_utf8()

    allocation should be avoided when possible since it's relatively slow
    abysssol committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    7eab2ab View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0cde2ec View commit details
    Browse the repository at this point in the history