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

fix: Use logging-only variables in release profile #30

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

Pscheidl
Copy link
Contributor

@Pscheidl Pscheidl commented Mar 8, 2023

Due to the logging format used, the existing format_args macro matches the logging macro args. It can be used to consume the variables used for logging, yet the output isn't used anywhere. Because this only happens in the release profile, rustc will remove the code completely.

Due to the logging format used, the existing `format_args` macro matches the
logging macro args. It can be used to consume the variables used for logging,
yet the output isn't used anywhere. Because this only happens in the `release`
profile, `rustc` will remove the code completely.
@Pscheidl
Copy link
Contributor Author

Pscheidl commented Mar 8, 2023

pavel@machine:~/Work/serde-env$ cargo build --release
   Compiling serde-env v0.1.1 (/home/pavel/Work/serde-env)
    Finished release [optimized] target(s) in 0.47s

@Xuanwo
Copy link
Owner

Xuanwo commented Mar 8, 2023

Great!

@Xuanwo Xuanwo merged commit 0fc4adf into Xuanwo:main Mar 8, 2023
@Pscheidl Pscheidl deleted the release-logging-unused-vars-fix branch March 8, 2023 12:57
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