19-下划线表达式
下划线表达式 — The Rust Reference
1分钟内可阅读完
译文 · 基于 The Rust Reference
原文链接: https://doc.rust-lang.org/reference/expressions/underscore-expr.html
r[expr.placeholder]
下划线表达式
r[expr.placeholder.syntax]
UnderscoreExpression -> `_`
r[expr.placeholder.intro]
下划线表达式用符号 _ 表示,用于在解构赋值中标记占位符。
r[expr.placeholder.lhs-assignment-only] 它们只能出现在赋值的左侧。
r[expr.placeholder.pattern] 注意,这与通配符模式不同。
_ 表达式的示例:
| |