Skip to content

Conversation

@ModProg
Copy link
Owner

@ModProg ModProg commented Jan 30, 2025

fixes #104

@ModProg ModProg requested a review from daxpedda January 30, 2025 21:54
@ModProg ModProg force-pushed the clone-skip branch 2 times, most recently from f472a56 to 5d00b0c Compare January 30, 2025 22:12
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Just hypothetically, what will we do when we get to a breaking change? Will we ever want derive_where(skip) to make Clone just call default() instead?

I'm thinking that letting Clone call default() under the term skip is not ideal and would clash with the general usage of derive_where(skip). I propose instead a new attribute: derive_where(clone_default) or derive_where(clone(default)). WDYT?

Will make a review of the code properly after figuring this out, because it would change the code entirely probably.

@ModProg
Copy link
Owner Author

ModProg commented Apr 10, 2025

I think I'm getting to a point there I'm questioning the global skip as a feature. I think it makes sense to have skips for EqHash etc. but just skipping for all traits that currently support the feature seems strange to me now

@daxpedda
Copy link
Collaborator

I think I'm getting to a point there I'm questioning the global skip as a feature. I think it makes sense to have skips for EqHash etc. but just skipping for all traits that currently support the feature seems strange to me now

Didn't cross my mind at all, but seems quite reasonable to me. In hindsight, a global skip almost looks like a footgun.

But unrelated, right? Or did you mean to keep skip(Clone) instead of a dedicated attribute considering you want to remove the global skip in the future?

@ModProg
Copy link
Owner Author

ModProg commented Apr 10, 2025

I feel like skip(Clone) is in line with other things that don't explicitly specify that Default will be used, when "removing" a value e.g. https://doc.rust-lang.org/std/mem/fn.take.html

@daxpedda
Copy link
Collaborator

Hm, skip to me implies that nothing is done, like with all the other traits skip supports right now. Clone definitely seems like a departure to me in this regard. While default() can imply something like "empty", as with std::mem::take(), it seems still different to me then "nothing" as "not used" or "skipped".

I will go ahead and review nevertheless, not a big issue really.

@ModProg
Copy link
Owner Author

ModProg commented Apr 10, 2025

I see your point, but thought of skip more as not doing the specific thing in this case cloning, but still doing what is required to allow the skipping, in this case defaulting.

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Looks great!
Just needs an update of the README.

@ModProg
Copy link
Owner Author

ModProg commented Apr 29, 2025

@daxpedda we need to mention that skip without group does not include clone

@ModProg
Copy link
Owner Author

ModProg commented Apr 29, 2025

maybe referencing #111

@daxpedda
Copy link
Collaborator

I specifically did not include Clone in the list for blanket skipping, but only in the list for group skips.
Doesn't that cover it?

@ModProg
Copy link
Owner Author

ModProg commented Apr 29, 2025

True, should be fine, especially with the aforementioned planed deprecation of the "skip all" feature.

@ModProg ModProg merged commit 93aad23 into main Apr 29, 2025
67 checks passed
@daxpedda daxpedda mentioned this pull request May 1, 2025
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.

Feature: Support skip on Clone derives

3 participants