Skip to content

Commit

Permalink
docs: update.
Browse files Browse the repository at this point in the history
  • Loading branch information
yassun7010 committed Jun 20, 2024
1 parent 22629d9 commit 0f8aafd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions serde_valid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ assert_eq!(
);
```

## Custom Method

## Custom Validation
### Single Error Validation
You can use your custom validation using by `#[validate(custom)]`.

```rust
Expand Down Expand Up @@ -265,7 +265,7 @@ let s = Data {
assert!(s.validate().is_ok());
```

## Multi Errors Validation
### Multi Errors Validation
If you want to return multiple errors in the use custom validation method, you can use `#[validate(custom)]` same as single error.

```rust
Expand Down Expand Up @@ -306,8 +306,7 @@ let s = Data { val: 1 };
assert!(s.validate().is_ok());
```

## Multi Fields Validation
### Custom Validation
### Multi Fields Validation
Now, you can use `#[validate(custom)]` for multi fields validation.

```rust
Expand Down
9 changes: 4 additions & 5 deletions serde_valid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@
//! # }
//! ```
//!
//! ## Custom Method
//!
//! ## Custom Validation
//! ### Single Error Validation
//! You can use your custom validation using by `#[validate(custom)]`.
//!
//! ```rust
Expand Down Expand Up @@ -275,7 +275,7 @@
//! assert!(s.validate().is_ok());
//! ```
//!
//! ## Multi Errors Validation
//! ### Multi Errors Validation
//! If you want to return multiple errors in the use custom validation method, you can use `#[validate(custom)]` same as single error.
//!
//! ```rust
Expand Down Expand Up @@ -316,8 +316,7 @@
//! assert!(s.validate().is_ok());
//! ```
//!
//! ## Multi Fields Validation
//! ### Custom Validation
//! ### Multi Fields Validation
//! Now, you can use `#[validate(custom)]` for multi fields validation.
//!
//! ```rust
Expand Down

0 comments on commit 0f8aafd

Please sign in to comment.