Skip to content

Minor follow-ups to #407#450

Merged
tnull merged 3 commits into
lightningdevkit:mainfrom
tnull:2025-01-407-followups
Jan 30, 2025
Merged

Minor follow-ups to #407#450
tnull merged 3 commits into
lightningdevkit:mainfrom
tnull:2025-01-407-followups

Conversation

@tnull
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread src/builder.rs
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
Copy Markdown

@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
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hah, true

Comment thread src/logger.rs
Copy link
Copy Markdown

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
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants