From 4149ae692b57f4ad8dcd1faba1061abb2cb68329 Mon Sep 17 00:00:00 2001 From: kumakichi Date: Mon, 28 Jun 2021 18:26:17 +0800 Subject: [PATCH 1/2] fix: code snippet --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 296f3a8..7410dca 100644 --- a/README.md +++ b/README.md @@ -8590,10 +8590,10 @@ where } fn main() { + let some_vec = vec![9, 8, 10]; do_something(|| { - let some_vec = vec![9, 8, 10]; some_vec - .iter() + .into_iter() .for_each(|x| println!("The number is: {}", x)); }) } From 6cac6d1da2c0c66829bfbb073389f1e342a471a2 Mon Sep 17 00:00:00 2001 From: kumakichi Date: Mon, 5 Jul 2021 09:52:55 +0800 Subject: [PATCH 2/2] fix: backquote --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7410dca..3bc62ed 100644 --- a/README.md +++ b/README.md @@ -9734,7 +9734,7 @@ And now it works, because on the stack is just a `Box` and we know the size of ` You see this a lot in the form `Box`, because sometimes you can have more than one possible error. -We can quickly create two error types to show this. To make an official error type, you have to implement `std::error::Error` for it. That part is easy: just write impl `std::error::Error {}`. But errors also need `Debug` and `Display` so they can give information on the problem. `Debug` is easy with `#[derive(Debug)]` but `Display` needs the `.fmt()` method. We did this once before. +We can quickly create two error types to show this. To make an official error type, you have to implement `std::error::Error` for it. That part is easy: just write `impl std::error::Error {}`. But errors also need `Debug` and `Display` so they can give information on the problem. `Debug` is easy with `#[derive(Debug)]` but `Display` needs the `.fmt()` method. We did this once before. The code looks like this: