Skip to content
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

Deduplicate Clone by always using match and { } #31

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Commits on Aug 1, 2024

  1. Preparation: impl Clone for IdentOrIndex

    We'll use this shortly.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    e4e505d View commit details
    Browse the repository at this point in the history
  2. Preparation: Impl IdentFragment for IdentOrIndex

    We'll use this in a moment.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    62bc987 View commit details
    Browse the repository at this point in the history
  3. Introduce FieldInfo and use in clone_enum

    No functional change, but this prepares the code for unification of
    handling of named and unnamed fields.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    aead687 View commit details
    Browse the repository at this point in the history
  4. Use braced syntax even for tuple and units, in clone_enum

    Demonstrate the named-vs-unnamed-agnostic approach.
    
    Unit, Named and Unnamed are all now handled by the named fields code,
    using the `{ }` syntax which Rust allows for every `Data`.
    
    The `match` statement is redundant, but removing it will involve a
    deindent so is very textually invasive.  We'll do that in the next
    commit.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    10cd174 View commit details
    Browse the repository at this point in the history
  5. Post-unification cleanup: remove now-redundant match

    Best reviewed with `git show -b`.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    3324410 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    941b9b2 View commit details
    Browse the repository at this point in the history
  7. Use match approach for struct clone

    The clone_enum code is now good for cloning structs.  Use it.
    
    The redundant block will be removed in a moment.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    1accc1d View commit details
    Browse the repository at this point in the history
  8. Post-unification cleanup: Remove redundant block

    Best reviewed with `git show -b`
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    461123b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    831b9e1 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    869dff8 View commit details
    Browse the repository at this point in the history
  11. Post-unification cleanup: rustfmt

    Apply deferred rewrapping.
    ijackson committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    1abd260 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4329fe8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    7434288 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    8728777 View commit details
    Browse the repository at this point in the history