projects
/
rust-101.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d20f370
)
Fixed typo.
author
Torsten Scheck
<torsten.scheck@gmx.de>
Wed, 28 Jun 2017 05:51:02 +0000
(07:51 +0200)
committer
Torsten Scheck
<torsten.scheck@gmx.de>
Wed, 28 Jun 2017 05:51:02 +0000
(07:51 +0200)
src/part10.rs
patch
|
blob
|
history
diff --git
a/src/part10.rs
b/src/part10.rs
index 66d18ff1fc63e23f68f609ff0234f98824807686..0c90369c47145464411d557acc2f44fcb74d6788 100644
(file)
--- a/
src/part10.rs
+++ b/
src/part10.rs
@@
-81,7
+81,7
@@
impl BigInt {
pub fn print_with_prefix(b: &BigInt, prefix: String) {
//@ The syntax for closures is `|arg1, arg2, ...| code`. Notice that the closure can reference variables like `prefix` that it did not
//@ take as argument - variables that happen to be present *outside* of the closure. We say that the closure *captures*
pub fn print_with_prefix(b: &BigInt, prefix: String) {
//@ The syntax for closures is `|arg1, arg2, ...| code`. Notice that the closure can reference variables like `prefix` that it did not
//@ take as argument - variables that happen to be present *outside* of the closure. We say that the closure *captures*
- //@ variables. Rust will now automatically create a type (like `PrintWithStr
uct
`) for the environment of the closure
+ //@ variables. Rust will now automatically create a type (like `PrintWithStr
ing
`) for the environment of the closure
//@ with fields for every captured variable, implement the closure trait for this type such that the action performed
//@ is given by the code of the closure, and finally it will instantiate the environment type here at the definition site
//@ of the closure and fill it appropriately.
//@ with fields for every captured variable, implement the closure trait for this type such that the action performed
//@ is given by the code of the closure, and finally it will instantiate the environment type here at the definition site
//@ of the closure and fill it appropriately.