We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在本书元组结构体部分,仅说明了声明元组结构体的语法,但是在对应的练习中练习中,第三题:
// 填空并修复错误 struct Color(i32, i32, i32); struct Point(i32, i32, i32); fn main() { let v = Point(__, __, __); check_color(v); } fn check_color(p: Color) { let (x, _, _) = p; // 这个地方需要使用解构语法,需要改正为let Point(x,y,z)=p assert_eq!(x, 0); assert_eq!(p.1, 127); assert_eq!(__, 255); }
元组结构体解构需要再次声明类型,建议在书中增加相关说明,我作为新手不看答案真不知道。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
在本书元组结构体部分,仅说明了声明元组结构体的语法,但是在对应的练习中练习中,第三题:
元组结构体解构需要再次声明类型,建议在书中增加相关说明,我作为新手不看答案真不知道。
The text was updated successfully, but these errors were encountered: