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
代码中的模式匹配使用了上下文都未提及的 ref 关键字. 此处是否应该有相关链接引用说明.
ref
if let Some(ref fgcolor) = self.fgcolor { if has_wrote { res.push(';'); } res.push_str(fgcolor.to_fg_str()); }
eg:
https://users.rust-lang.org/t/ref-keyword-versus/18818 https://doc.rust-lang.org/stable/rust-by-example/scope/borrow/ref.html https://stackoverflow.com/questions/58292554/what-can-ref-do-that-references-couldnt
The text was updated successfully, but these errors were encountered:
@Kreedzt 感谢反馈。 ref 在第二章应该提过吧?
Sorry, something went wrong.
第二章中2.3.1节中: 只有一句话提及: 表达式的求值过程在不同的上下文中会有不同的结果. 求值上下文也分为 位置上下文 (Place Context) 和 值上下文(Value Context). 下面几种表达式属于位置上下文: ....
match 判别式或 let 绑定右侧在使用 ref 模式匹配的时候也是位置上下文.
噢,可能忘记了,这个应该在模式匹配里讲一下的。只能第二版里增加了。
这个 ref 是模式匹配,匹配出 fgclolor的引用。
No branches or pull requests
疑问
代码中的模式匹配使用了上下文都未提及的
ref
关键字.此处是否应该有相关链接引用说明.
eg:
https://users.rust-lang.org/t/ref-keyword-versus/18818
https://doc.rust-lang.org/stable/rust-by-example/scope/borrow/ref.html
https://stackoverflow.com/questions/58292554/what-can-ref-do-that-references-couldnt
The text was updated successfully, but these errors were encountered: