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

chore: import in macro body for improved readablity #1462

Conversation

ArniStarkware
Copy link
Contributor

No description provided.

@lotem-starkware
Copy link
Contributor

This change is Reviewable

Copy link
Contributor Author

ArniStarkware commented Oct 20, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ArniStarkware and the rest of your teammates on Graphite Graphite

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.17%. Comparing base (b0cfe82) to head (10a80aa).
Report is 429 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1462      +/-   ##
==========================================
- Coverage   74.18%   70.17%   -4.02%     
==========================================
  Files         359       95     -264     
  Lines       36240    13039   -23201     
  Branches    36240    13039   -23201     
==========================================
- Hits        26886     9150   -17736     
+ Misses       7220     3489    -3731     
+ Partials     2134      400    -1734     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware, @dorimedini-starkware, and @MohammadNassar1)

a discussion (no related file):
How come no imports are removed from files that use these macros?


@ArniStarkware ArniStarkware requested a review from elintul October 20, 2024 06:44
Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @elintul, and @MohammadNassar1)

a discussion (no related file):

Previously, elintul (Elin) wrote…

How come no imports are removed from files that use these macros?

In this PR we do not remove any "imports". In this set of macros the path to the structs was already used in the macro.
The goal of this PR is to make these macros more readable (by using the use inside the macro technology).

The goal was to make this less readable lines like this one:

 if let cairo_vm::vm::errors::vm_errors::VirtualMachineError::Hint(hint) = $inner_exc {
            if let cairo_vm::vm::errors::hint_errors::HintError::Internal(
                cairo_vm::vm::errors::vm_errors::VirtualMachineError::Other(error),
            ) = &hint.1

into

if let VirtualMachineError::Hint(hint) = $inner_exc {
            if let HintError::Internal(VirtualMachineError::Other(error)) = &hint.1


Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware, @dorimedini-starkware, and @MohammadNassar1)

a discussion (no related file):

Previously, ArniStarkware (Arnon Hod) wrote…

In this PR we do not remove any "imports". In this set of macros the path to the structs was already used in the macro.
The goal of this PR is to make these macros more readable (by using the use inside the macro technology).

The goal was to make this less readable lines like this one:

 if let cairo_vm::vm::errors::vm_errors::VirtualMachineError::Hint(hint) = $inner_exc {
            if let cairo_vm::vm::errors::hint_errors::HintError::Internal(
                cairo_vm::vm::errors::vm_errors::VirtualMachineError::Other(error),
            ) = &hint.1

into

if let VirtualMachineError::Hint(hint) = $inner_exc {
            if let HintError::Internal(VirtualMachineError::Other(error)) = &hint.1

Not sure I understand.


@ArniStarkware
Copy link
Contributor Author

This PR may cause longer compilation times.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2024
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