Skip to content

refactor: 使用惯用 Rust 写法简化 Option 工具函数#285

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

refactor: 使用惯用 Rust 写法简化 Option 工具函数#285
heqingpan merged 1 commit intonacos-group:masterfrom
lly835:refactor/simplify-utils

Conversation

@lly835
Copy link

@lly835 lly835 commented Feb 26, 2026

  • select_option_by_clone: 用 or_else 替换 match
  • merge_option: 用 Option::or 替换 match
  • 无行为变更,仅改为更惯用的 Rust 写法

- select_option_by_clone: use or_else instead of match
- merge_option: use Option::or instead of match
- No behavior change, just more idiomatic
@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: simplify Option utility functions with idiomatic Rust refactor: 使用惯用 Rust 写法简化 Option 工具函数 Feb 26, 2026
@heqingpan heqingpan merged commit c014c1a 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