Skip to content

Commit 87b589c

Browse files
authored
Merge pull request #1331 from ScriptDevil/patch-1
Capture example should use String
2 parents e7b0f62 + 634e6f6 commit 87b589c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fn/closures/capture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ required.
1616
fn main() {
1717
use std::mem;
1818
19-
let color = "green";
19+
let color = String::from("green");
2020
2121
// A closure to print `color` which immediately borrows (`&`) `color` and
2222
// stores the borrow and closure in the `print` variable. It will remain

0 commit comments

Comments
 (0)