Skip to content

Allow topo::Builder::with_tips and with_ends for non-default pred #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

neithernut
Copy link
Contributor

We recently (in #1716) introduced the associated fns with_tips and with_ends for adding tips and ends after initial creation of a Builder. We erroneously added them to the one impl constraining the predicate to a specific function pointer type for the default predicate. This meant that tips and ends could only be added until the predicate is set to a FnMut that can not be coerced to that same type.

This change lifts this limitation by moving with_tips and with_ends to the more generic impl for Builder.

--

Sorry for the noise. I should have paid more attention where I put those functions. Btw: the rationale for this change also holds for with_predicate imo. Typically users will only set a predicate once and not change it afterwards, but it doesn't exactly hurt to have it in the impl generic over Predicate.

We recently introduced the associated fns `with_tips` and `with_ends`
for adding tips and ends after initial creation of a `Builder`. We
erroneously added them to the one impl constraining the predicate to a
specific function pointer type for the default predicate. This meant
that tips and ends could only be added until the predicate is set to
a `FnMut` that can not be coerced to that same type.

This change lifts this limitation by moving `with_tips` and `with_ends`
to the more generic impl for `Builder`.
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, and… I also missed this in my armchair review.

One would have thought that using the functions oneself in the implementation would catch all compiler related issues and that this is all trivial, but think again :D.

@Byron Byron merged commit 3e63721 into GitoxideLabs:main Dec 11, 2024
20 checks passed
@neithernut neithernut deleted the traverse-broaden-with-tips-ends branch December 11, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants