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

refactor: error_msg into a macro #18

Open
massivebird opened this issue Mar 13, 2024 · 1 comment
Open

refactor: error_msg into a macro #18

massivebird opened this issue Mar 13, 2024 · 1 comment

Comments

@massivebird
Copy link
Owner

Check out this StackOverflow discussion that talks about creating a custom format! style macro! I just did this for Subterfuge :3

Changing the symbol name is a good idea, too. Get a verb in there! Even something long like print_error! would be an improvement.

@massivebird
Copy link
Owner Author

Before implementing this, I want to figure out an idiomatic way to print the macro arguments after prefixing them with some string. The subterfuge implementation uses a clunky print! followed by a println!. I want to do better for arcconfig.

massivebird added a commit that referenced this issue Apr 23, 2024
Resolves: #18

This allows invocations of `error_msg` to be a little cleaner. Before,
invocations looked like `error_msg(&format(str))` but the string
formatting is now "baked in" to the new macro. Invocations can now
resemble `error_msg!(str)`.
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

No branches or pull requests

1 participant