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

Move crates into crates/ and rename plural modules to singular #1091

Merged
merged 6 commits into from
Jan 22, 2025

Conversation

PhilippGackstatter
Copy link
Contributor

Move crates into crates/ and rename plural modules to singular.

Closes #1021 and #1062.

I renamed plurals to singular whenever the containing type was singular but the module was not. For example Asset was in assets/mod.rs, so I renamed it to asset/mod.rs.

However, when the containing type is plural or we have or anticipate multiple types to be contained in a module, I left them as plural. Modules deliberately left as plural:

  • crates/miden-objects/src/constants.rs which contains multiple constants.
  • crates/miden-objects/src/transaction/tx_args.rs which contains TransactionArgs.
  • crates/miden-objects/src/note/details.rs which contains NoteDetails.
  • crates/miden-objects/src/transaction/inputs.rs which contains InputNotes, ToInputNoteCommitments, TransactionInputs.
  • crates/miden-objects/src/note/inputs.rs which contains NoteInputs.
  • crates/miden-objects/src/transaction/outputs.rs which contains OutputNotes, TransactionOutputs.
    • This one also contains OutputNote, so it's impossible to satisfy the above criteria here.
  • errors modules, since they usually contain multiple error types.
  • crates/miden-objects/src/transaction/events.rs module which contains multiple event constants.
  • crates/miden-objects/src/note/assets.rs which contains NoteAssets.
  • crates/miden-tx/src/auth/signatures which might contain more signatures in the future.
  • I also left crates/miden-lib/asm intact, because we anticipate to have multiple kernels, account_components, note_scripts, etc. so using plural seems fine. For the same reason the modules in crates/miden-lib/src/account/ were left as-is.

Feel free to disagree, though, I don't have a strong opinion on those. This is just the rationale I've followed.

@PhilippGackstatter PhilippGackstatter marked this pull request as ready for review January 21, 2025 16:04
Base automatically changed from pgackst-source-errors to next January 22, 2025 12:51
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

All looks good! Thank you!

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