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

models/krate: Improve feature validation #7537

Merged
merged 4 commits into from
Nov 16, 2023

Commits on Nov 15, 2023

  1. models/krate: Use assert_ok/err!() assertion macros

    Compared to the output of `assert!()` (`true != false`), these give a bit more context on the actual and expected values.
    Turbo87 committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    cd1d40a View commit details
    Browse the repository at this point in the history
  2. models/krate: Adjust naming of fns that return Result

    `valid` is a property name, which suggests that the fn returns a `bool`. If the fn returns a `Result` it's better to name the function like an action, e.g. `validate`.
    Turbo87 committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    efc598b View commit details
    Browse the repository at this point in the history
  3. models/krate: Extract custom error types

    The `models` module should ideally not know anything about the HTTP API layer and the `cargo_err()` fn.
    Turbo87 committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    6ffd5dd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0e0feda View commit details
    Browse the repository at this point in the history