Skip to content

Commit

Permalink
ctx is always a ref
Browse files Browse the repository at this point in the history
  • Loading branch information
lasantosr committed Jan 19, 2025
1 parent 5c51a55 commit ecd9bac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if let Err(e) = data.validate() {

Additional notes:
- `required` is only available for `Option` fields.
- `dive` accepts an optional context: `#[garde(dive(&self.other_field))]`
- `dive` accepts an optional context: `#[garde(dive(self.other_field))]`
- The `<mode>` argument for `length` is [explained here](#length-modes)
- For `length` and `range`:
- If `equal` is defined, `min` and `max` must be omitted.
Expand Down
2 changes: 1 addition & 1 deletion garde/tests/rules/dive_with_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Test<'a> {
min: usize,
#[garde(skip)]
max: usize,
#[garde(dive(&(self.min, self.max)))]
#[garde(dive((self.min, self.max)))]
inner: Inner<'a>,
}

Expand Down
2 changes: 1 addition & 1 deletion garde_derive/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ where
(Some((_, Some(ctx))), None) => Some(quote! {
::garde::validate::Validate::validate_into(
&*__garde_binding,
#ctx,
&#ctx,
&mut __garde_path,
__garde_report,
);
Expand Down

0 comments on commit ecd9bac

Please sign in to comment.