Skip to content

Seed's UpdateEl::update method clashes with Itertools #370

Closed
@rebo

Description

@rebo

This issue was just reported on Discord #support by user BestRanar . When using itertools and iterators in seed views that have not been terminated with a collect::<Vec<_>>() there is a disambiguation compiler error generated from the seed macro.

error[E0034]: multiple applicable items in scope

note: candidate #1 is defined in an impl of the trait 'seed::virtual_dom::update_el::UpdateEl' for the type 'std::iter::FilterMap<_, _>'

note: this error originates in a macro outside of the current crate

Basically rust does not know whether to use Seed's update function or Itertools's update.

Probably the best bet to fix is to change the name of Seed's view macro update() method to something like seed_update(). The reason for this is that Seed's update is internal to the seed macros and in theory not a public api and Itertools is common enough that this clash will come up more frequently.

Another fix is to disambiguate directly in the seed macro, however this prevents implementation of custom UpdateEls by a user if needed.

The temporary fix to the above is to terminate iterators with a collect() if using itertools.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions