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

Use one macro instead of the same code twice, avoid seperated changes #365

Merged

Conversation

Lakelezz
Copy link
Contributor

@Lakelezz Lakelezz commented Aug 10, 2018

Instead of having the exact same logic and code twice, this pull request uses a macro.

This has three advantages:

  1. Code only needs to be changed inside the macro, thus no one can update one code-section and forget the other.
  2. Less code repetition.
  3. We do not have to rely on comments to describe that someone has to find and change both pieces of code.

@Lakelezz Lakelezz added the enhancement An improvement to Serenity. label Aug 10, 2018
@Lakelezz Lakelezz changed the title Use one macro instead of the same code twice, avoid seperated changes. Use one macro instead of the same code twice, avoid seperated changes Aug 10, 2018
@Lymia
Copy link
Contributor

Lymia commented Aug 10, 2018

why a macro and not a function

@Lakelezz Lakelezz merged commit 516ede3 into serenity-rs:master Aug 11, 2018
@Lakelezz Lakelezz deleted the use-macro-for-args-construction branch October 9, 2018 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to Serenity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants