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

Update garde requirement from 0.17.0 to 0.18.0 #1400

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 29, 2024

Updates the requirements on garde to permit the latest version.

Release notes

Sourced from garde's releases.

v0.18.0

There are quite a few changes in this release:

Some of these are breaking changes. If you are only using the derive functionality and calling validate, updating should still be as simple as a version bump:

cargo add garde@0.18 -F full

If it isn't, please open an issue!

Length modes

You can now specify what kind of length you wish to validate by adding a new mode argument to your length rules. The argument is optional.

#[derive(garde::Validate)]
#[garde(transparent)]
struct Username(
    #[garde(
        length(bytes, min = 1, max = 100),
        length(graphemes, min = 1, max = 25)
    )]
    String
);

The above validates both bytes (via v.len()) and graphemes (via v.graphemes().count() using the unicode-segmentation crate. To understand why the distinction is important, consider the x character, which occupies 73 bytes in memory, but is considered a single grapheme.

The available modes are:

  • simple, which is the default, and its behavior depends on the type. For strings, it measures the number of bytes, and for collections (such as Vec), it meaures the number of items.
  • bytes, which uses s.len(), measuring the number of bytes,
  • graphemes, which uses s.graphemes(true).count(), measuring the number of graphemes
  • chars, which uses s.chars().count(), measuring the number of unicode scalar values
  • utf16, which uses s.encode_utf16().count(), measuring the number of UTF-16 code units

The original Length and HasLength traits have been removed, and replaced by one trait per length mode.

Adapters

Using adapters, it is possible to implement validation rules for 3rd-party types directly in your own crates.

mod my_str_adapter {
    #![allow(unused_imports)]
    pub use garde::rules::*; // re-export garde's rules
</tr></table>

... (truncated)

Commits
  • eb627df update versions
  • 4f057f0 Merge pull request #95 from jprochazk/no-default-features
  • 987d783 use --all-features in check
  • 5d3d443 remove default features, add full
  • 068ac5d Merge pull request #93 from jprochazk/adapters
  • 240e54e add docs
  • 31f3e9a implement #[garde(adapt)]
  • 291d042 Merge pull request #91 from jprochazk/newtype-empty-display
  • 3055d4b remove empty colon from display impl of report
  • 7ccf734 Merge pull request #90 from jprochazk/report-serde
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [garde](https://github.com/jprochazk/garde) to permit the latest version.
- [Release notes](https://github.com/jprochazk/garde/releases)
- [Commits](https://github.com/jprochazk/garde/compare/garde@0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: garde
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies upgrades to dependencies label Jan 29, 2024
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (911f453) 72.1% compared to head (686930f) 72.1%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1400   +/-   ##
=====================================
  Coverage   72.1%   72.1%           
=====================================
  Files         75      75           
  Lines       6470    6470           
=====================================
  Hits        4663    4663           
  Misses      1807    1807           

@clux clux added this to the 0.89.0 milestone Jan 29, 2024
@clux clux added the changelog-exclude changelog excluded prs label Jan 29, 2024
@clux clux merged commit d449353 into main Jan 29, 2024
17 checks passed
@clux clux deleted the dependabot/cargo/garde-0.18.0 branch January 29, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-exclude changelog excluded prs dependencies upgrades to dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant