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

Add additional traits and methods to DeprecatedSyscallSelector #24

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

THenry14
Copy link
Member

Implements #10

Introduced changes

  • add missing traits and methods to DeprecatedSyscallSelector

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@THenry14 THenry14 requested a review from ksew1 October 30, 2024 13:52
Copy link
Member

@ksew1 ksew1 left a comment

Choose a reason for hiding this comment

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

What do you think about using the strum crate for this? We could then just use its derives instead of writing this code.

@THenry14
Copy link
Member Author

THenry14 commented Nov 4, 2024

What do you think about using the strum crate for this? We could then just use its derives instead of writing this code.

I thought about it to be honest, even started the implementation. I then figured that maybe it is not really worth it the additional dependency to only do this for one enum. I'm not strong on that opinion though, so if you like this better let me know and I can change it.

One general thing though - I am actually thinking about refactoring this enum completely, as it's not really fit for purpose at the moment. I have vague plans to split it into syscalls and libfuncs, which would allow to get rid of fromstr and tostr traits. But this work is not yet planned completely, for now I hold it in an issue in the profiler's triage. Will open an issue/PR here when it's needed/planned.

@THenry14 THenry14 requested a review from ksew1 November 4, 2024 08:21
@ksew1
Copy link
Member

ksew1 commented Nov 4, 2024

What do you think about using the strum crate for this? We could then just use its derives instead of writing this code.

I thought about it to be honest, even started the implementation. I then figured that maybe it is not really worth it the additional dependency to only do this for one enum. I'm not strong on that opinion though, so if you like this better let me know and I can change it.

One general thing though - I am actually thinking about refactoring this enum completely, as it's not really fit for purpose at the moment. I have vague plans to split it into syscalls and libfuncs, which would allow to get rid of fromstr and tostr traits. But this work is not yet planned completely, for now I hold it in an issue in the profiler's triage. Will open an issue/PR here when it's needed/planned.

We are already dragging a lot of dependencies through cairo-lang-*. My only concern is that when we add some variant, we need to add it in three places instead of just one. I would personally go with strum

@THenry14
Copy link
Member Author

THenry14 commented Nov 6, 2024

What do you think about using the strum crate for this? We could then just use its derives instead of writing this code.

I thought about it to be honest, even started the implementation. I then figured that maybe it is not really worth it the additional dependency to only do this for one enum. I'm not strong on that opinion though, so if you like this better let me know and I can change it.
One general thing though - I am actually thinking about refactoring this enum completely, as it's not really fit for purpose at the moment. I have vague plans to split it into syscalls and libfuncs, which would allow to get rid of fromstr and tostr traits. But this work is not yet planned completely, for now I hold it in an issue in the profiler's triage. Will open an issue/PR here when it's needed/planned.

We are already dragging a lot of dependencies through cairo-lang-*. My only concern is that when we add some variant, we need to add it in three places instead of just one. I would personally go with strum

Sure, makes sense. Made the change and tested it against the profiler code, everything seems to be working 👍

Copy link
Member

@ksew1 ksew1 left a comment

Choose a reason for hiding this comment

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

Don't want to block you 😅. Please only address my comment

@THenry14 THenry14 merged commit d8321bd into main Nov 7, 2024
4 checks passed
@ksew1 ksew1 deleted the szymczyk/10-use-in-profiler branch November 24, 2024 17:14
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