Skip to content

修正序列(Range)章节关于“判空”类型与步进逻辑的错误描述#1598

Merged
sunface merged 1 commit intosunface:mainfrom
euclidsystem:fix-range-description
Mar 9, 2026
Merged

修正序列(Range)章节关于“判空”类型与步进逻辑的错误描述#1598
sunface merged 1 commit intosunface:mainfrom
euclidsystem:fix-range-description

Conversation

@euclidsystem
Copy link
Copy Markdown

原文中提到“数字和字符是 Rust 中仅有的可以用于判断是否为空的类型”,这在技术上是不准确的(忽略了 Vec、String、Option 等大量可判空类型),容易误导初学者。
修改内容:删除了关于“仅有的判空类型”的表述;明确序列支持数字和字符是因为它们具备离散连续性(Step 特征),能明确步进逻辑;解释了“空”是指区间范围(如 5..1),而非类型本身的属性。

…字和字符是因为其具备连续步进特性(Step trait)的逻辑;澄清了空是指序列区间为空(如 5..1),而非类型本身是否为空。
Copy link
Copy Markdown
Owner

@sunface sunface left a comment

Choose a reason for hiding this comment

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

之前的描述确实有问题,感谢指正 👍

@sunface sunface merged commit b19ea30 into sunface:main Mar 9, 2026
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