rust - 下划线开头的变量名称的作用
访问量: 2030
参考:https://stackoverflow.com/questions/48361537/why-do-underscore-prefixed-variables-exist
1. 该变量可能不会被使用
2. underscore binding
3. destruction的时候(解析某个结构体成为多个变量),如果解析出来5个,有3个不考虑,直接仍掉,那么就可以使用 _ 变量。
访问量: 2030
参考:https://stackoverflow.com/questions/48361537/why-do-underscore-prefixed-variables-exist
1. 该变量可能不会被使用
2. underscore binding
3. destruction的时候(解析某个结构体成为多个变量),如果解析出来5个,有3个不考虑,直接仍掉,那么就可以使用 _ 变量。