Skip to content

refactor: 提取 datetime_utils 中的共享 since_epoch() 辅助函数#286

Merged
heqingpan merged 1 commit intonacos-group:masterfrom
lly835:refactor/datetime-dedup
Mar 1, 2026
Merged

refactor: 提取 datetime_utils 中的共享 since_epoch() 辅助函数#286
heqingpan merged 1 commit intonacos-group:masterfrom
lly835:refactor/datetime-dedup

Conversation

@lly835
Copy link

@lly835 lly835 commented Feb 26, 2026

  • 移除 4 处冗余的内部 use std::time::SystemTime 导入
  • 将重复的 SystemTime::now().duration_since(UNIX_EPOCH).unwrap() 提取为 since_epoch()
  • expect 替换裸 unwrap,提供更好的 panic 诊断信息

- Remove 4 redundant 'use std::time::SystemTime' inner imports
- Extract duplicated SystemTime::now().duration_since(UNIX_EPOCH).unwrap() into since_epoch()
- Add explicit expect message instead of bare unwrap for better panic diagnostics
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@lly835
Copy link
Author

lly835 commented Feb 26, 2026

@CLAassistant check

@lly835 lly835 changed the title refactor: extract shared since_epoch() helper in datetime_utils refactor: 提取 datetime_utils 中的共享 since_epoch() 辅助函数 Feb 26, 2026
@heqingpan heqingpan merged commit 7a187bb into nacos-group:master Mar 1, 2026
8 of 9 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.

4 participants