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
暂无
代码清单6-81 any的源码如下
#[inline] #[stable(feature = "rust1", since = "1.0.0")] fn any<F>(&mut self, f: F) -> bool where Self: Sized, F: FnMut(Self::Item) -> bool, { #[inline] fn check<T>(mut f: impl FnMut(T) -> bool) -> impl FnMut((), T) -> ControlFlow<()> { move |(), x| { if f(x) { ControlFlow::BREAK } else { ControlFlow::CONTINUE } } } self.try_fold((), check(f)) == ControlFlow::BREAK } ... #[inline] #[stable(feature = "iterator_try_fold", since = "1.27.0")] fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R where Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Output = B>, { let mut accum = init; while let Some(x) = self.next() { accum = f(accum, x)?; } try { accum } }
期待在第二版中可以讲下 try
$ rustc -V rustc 1.57.0-nightly (8f8092cc3 2021-09-28)
无
The text was updated successfully, but these errors were encountered:
@kingeasternsun 收到。感谢反馈
Sorry, something went wrong.
期望老师也可以在书里面讲下这个 ControlFlow
@kingeasternsun 收到。感谢反馈 期望老师也可以在书里面讲下这个 ControlFlow
必须的,第二版里安排上了。
No branches or pull requests
页码与行数
文本或排版错误
代码错误
代码清单6-81 any的源码如下
期待在第二版中可以讲下 try
Rust版本
错误信息
无
The text was updated successfully, but these errors were encountered: