Skip to content

Commit

Permalink
call EnumIter::get using fully qualified syntax (#2321)
Browse files Browse the repository at this point in the history
* call `EnumIter::get` using fully qualified syntax

`itertools` version 0.13.0 added a `get` method that takes precedence
over the `EnumIter::get` method. The `EnumIter` derive should be calling
the method fully-qualified to ensure that the local version is called
rather than the method that is provided by the `Itertools` trait. This
was fixed in `strum` 0.26.x, but since this is a forked/adapted version
of the `EnumIter` derive, it requires the same fix .

* CHANGELOG

---------

Co-authored-by: Billy Chan <[email protected]>
  • Loading branch information
jcreekmore and billy1624 authored Oct 4, 2024
1 parent e13b23c commit fb44229
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

+ `1.1.0-rc.1`: 2024-08-09

### Enhancements

* [sea-orm-macros] Call `EnumIter::get` using fully qualified syntax https://github.com/SeaQL/sea-orm/pull/2321

### Upgrades

* Upgrade `sqlx` to `0.8.2` https://github.com/SeaQL/sea-orm/pull/2305, https://github.com/SeaQL/sea-orm/pull/2371
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-macros/src/strum/enum_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
::core::option::Option::None
} else {
self.idx = idx;
self.get(idx - 1)
#iter_name::get(self, idx - 1)
}
}
}
Expand All @@ -154,7 +154,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
::core::option::Option::None
} else {
self.back_idx = back_idx;
self.get(#variant_count - self.back_idx)
#iter_name::get(self, #variant_count - self.back_idx)
}
}
}
Expand Down

0 comments on commit fb44229

Please sign in to comment.