Skip to content

Commit

Permalink
Update and fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Keats committed Jul 25, 2024
1 parent 9a5880c commit 6ed8c3f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
- rust: 1.70.0 # MSRV
- rust: stable
- rust: beta
- rust: nightly
steps:
- uses: actions/checkout@v3
- name: Install Rust
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ pub struct ValidationError {
```
The value of the field will automatically be added to the params with a key of `value`.

Note that `validator` works in conjunction with serde: in the example we can see that the `first_name`
field is renamed from/to `firstName`. Any error on that field will be in the `firstName` key of the hashmap,
not `first_name`.

The other two `ValidationErrorsKind` types represent errors discovered in nested (vectors of) structs, as described in
this example:

Expand Down
2 changes: 1 addition & 1 deletion validator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "../README.md"
url = "2"
regex = { version = "1", default-features = false, features = ["std"] }
once_cell = "1.18.0"
idna = "0.5"
idna = "1"
serde = "1"
serde_derive = "1"
serde_json = "1"
Expand Down
2 changes: 1 addition & 1 deletion validator_derive/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub(crate) static NUMBER_TYPES: Lazy<Vec<String>> = Lazy::new(|| {
pub struct ValidateField {
pub ident: Option<syn::Ident>,
pub ty: syn::Type,
pub attrs: Vec<syn::Attribute>,
// pub attrs: Vec<syn::Attribute>,
pub credit_card: Option<Override<Card>>,
pub contains: Option<Contains>,
pub does_not_contain: Option<DoesNotContain>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ error[E0599]: no method named `validate_length` found for type `usize` in the cu
--> tests/compile-fail/length/wrong_type.rs:3:10
|
3 | #[derive(Validate)]
| ^^^^^^^^ method not found in `usize`
| ^^^^^^^^
|
help: there is a method `validate_range` with a similar name, but with different arguments
--> $WORKSPACE/validator/src/validation/range.rs
|
| / fn validate_range(
| | &self,
| | min: Option<T>,
| | max: Option<T>,
| | exclusive_min: Option<T>,
| | exclusive_max: Option<T>,
| | ) -> bool {
| |_____________^
= note: this error originates in the derive macro `Validate` (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 6ed8c3f

Please sign in to comment.