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

Minor follow-ups to #407 #450

Merged
merged 3 commits into from
Jan 30, 2025
Merged

Conversation

tnull
Copy link
Collaborator

@tnull tnull commented Jan 30, 2025

Based on #407 until that is merged.

We add some minor cleanups here.

(cc @enigbe)

@tnull tnull force-pushed the 2025-01-407-followups branch 2 times, most recently from b8c928a to 44c4df4 Compare January 30, 2025 12:51
@tnull tnull added this to the 0.5 milestone Jan 30, 2025
@tnull tnull requested a review from arik-so January 30, 2025 13:04
@tnull tnull force-pushed the 2025-01-407-followups branch from 9b2fddb to 11161e1 Compare January 30, 2025 13:54
Copy link
Contributor

@enigbe enigbe left a comment

Choose a reason for hiding this comment

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

Thanks for adding this.
I have reviewed and tested. This LGTM.

tnull added 3 commits January 30, 2025 17:14
We slightly improve readability of `setup_logger`, and also clean up
some of the `DEFAULT` consts while we're at it.
.. tabs, not spaces. This one seemed to have slipped by `cargo fmt`
Now that we made the `logger` module `pub`, we can drop the type exports
at crate level
@tnull tnull force-pushed the 2025-01-407-followups branch from 11161e1 to b968ea7 Compare January 30, 2025 16:17
let log_file_path = log_file_path
.clone()
.unwrap_or_else(|| format!("{}/{}", config.storage_dir_path, DEFAULT_LOG_FILENAME));
let log_level = log_level.unwrap_or_else(|| DEFAULT_LOG_LEVEL);
Copy link

@arik-so arik-so Jan 30, 2025

Choose a reason for hiding this comment

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

I wonder how much we gain from using an or_else closure for a constant instead of or here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hah, true

Copy link

Choose a reason for hiding this comment

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

I wonder how cargo fmt didn't catch that?

Copy link
Collaborator Author

@tnull tnull Jan 30, 2025

Choose a reason for hiding this comment

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

It doesn’t touch macros.

@tnull tnull merged commit 574842c into lightningdevkit:main Jan 30, 2025
7 of 14 checks passed
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.

3 participants