Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Renames AccountsPackageType to AccountsPackageKind #32908

Merged

Conversation

brooksprumo
Copy link
Contributor

Problem

When creating an enum to select some underlying kind of a thing, we sometimes append Enum or Type for the name of the type. I think both of these are bad, but not life ending.

Obviously the variants are not types in the Rust sense of the word. And the type is already an enum, so adding Enum feels redundant.

In the Rust std lib, they have this problem for errors. They've solved this with ErrorKind.

(Some non-Rust projects have also used Flavor too, which I like, but not as much as Kind.)

AccountsPackageType has this naming problem.

Summary of Changes

Rename AccountsPackageType to AccountsPackageKind.

@brooksprumo brooksprumo self-assigned this Aug 19, 2023
@brooksprumo brooksprumo marked this pull request as ready for review August 19, 2023 23:36
@brooksprumo brooksprumo requested a review from apfitzge August 19, 2023 23:36
@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #32908 (ddd886d) into master (4d3bcc5) will increase coverage by 0.0%.
Report is 4 commits behind head on master.
The diff coverage is 91.2%.

❗ Current head ddd886d differs from pull request most recent head 130cb28. Consider uploading reports for the commit 130cb28 to get more accurate results

@@           Coverage Diff           @@
##           master   #32908   +/-   ##
=======================================
  Coverage    82.0%    82.0%           
=======================================
  Files         785      785           
  Lines      212377   212375    -2     
=======================================
+ Hits       174171   174208   +37     
+ Misses      38206    38167   -39     

@brooksprumo brooksprumo force-pushed the enum-kind/accounts-package branch 4 times, most recently from ddd886d to e94da19 Compare August 21, 2023 16:02
@brooksprumo brooksprumo force-pushed the enum-kind/accounts-package branch from e94da19 to 130cb28 Compare August 21, 2023 16:03
Copy link
Contributor

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

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

lgtm

@brooksprumo brooksprumo merged commit a8c1dab into solana-labs:master Aug 21, 2023
@brooksprumo brooksprumo deleted the enum-kind/accounts-package branch August 21, 2023 17:00
@KirillLykov
Copy link
Contributor

KirillLykov commented Aug 22, 2023

Thanks for the explanation, I was thinking about Type vs Kind recently and wonder what is the best-practice way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants