1
5
我认为这只是模式匹配的一个限制,旨在防止意外行为。
完整的“定义”
要忽略多个值,可以使用
记住,与其他一些语言不同,Rust枚举“不仅仅”是不同类型的集合。与枚举值关联的数据是它的一部分,就像结构的字段一样。所以
我还想指出
|
2
0
我需要这样的东西来很好地将函数链接在一起。在这种情况下,您希望返回未包装的核心类型,而不仅仅是枚举。
我还发现不使用输入更容易,因此接受了
这个
Rust convention
有
|
newbie99 · 如何向字符串片段暗示特定数量的字节 2 年前 |
David · `match的手臂类型不兼容 2 年前 |
Lucas Lima · 如何打印对象的元素? 2 年前 |
Xavi Font · 访问父结构中可选对象/结构/变量的属性 2 年前 |
Kai · 有什么方法可以轻松优化VSCode中的锈迹? 2 年前 |