Skip to content

Commit

Permalink
Add byte_length deprecated attribute message
Browse files Browse the repository at this point in the history
  • Loading branch information
dpytaylo committed Jan 2, 2024
1 parent 964e538 commit 8301f9f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion garde_derive/src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,13 @@ fn check_rule(
CreditCard => apply!(rule_set, CreditCard(), span),
PhoneNumber => apply!(rule_set, PhoneNumber(), span),
Length(v) => apply!(rule_set, Length(check_range_generic(v)?), span),
ByteLength(v) => apply!(rule_set, ByteLength(check_range_generic(v)?), span),
ByteLength(v) => {
#[deprecated = "the `byte_length` attribute is deprecated. Use `length` instead. (See https://github.com/jprochazk/garde/issues/84)"]
fn byte_length_deprecated() {}
byte_length_deprecated();

apply!(rule_set, ByteLength(check_range_generic(v)?), span);
}
Range(v) => apply!(rule_set, Range(check_range_not_ord(v)?), span),
Contains(v) => apply!(rule_set, Contains(v), span),
Prefix(v) => apply!(rule_set, Prefix(v), span),
Expand Down

0 comments on commit 8301f9f

Please sign in to comment.