Created
March 6, 2021 22:50
-
-
Save GoldsteinE/450e3d6fb86f21e73401e4c03e0a645f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: captured variable cannot escape `FnMut` closure body | |
--> components/rendering/src/markdown.rs:208:17 | |
| | |
176 | let mut highlighter: Option<CodeBlock> = None; | |
| --------------- variable defined here | |
... | |
197 | .map(|event| { | |
| - inferred to be a `FnMut` closure | |
... | |
208 | / Ok(Either::Right(events.into_iter().map(|event| { | |
209 | | match event { | |
210 | | Event::Text(text) => { | |
211 | | // if we are in the middle of a highlighted code block | |
212 | | if let Some(ref mut code_block) = highlighter { | |
| | ----------- variable captured here | |
... | | |
346 | | } | |
347 | | }))) | |
| |____________________^ returns a reference to a captured variable which escapes the closure body | |
| | |
= note: `FnMut` closures only have access to their captured variables while they are executing... | |
= note: ...therefore, they cannot allow references to captured variables to escape |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment