Skip to content
New issue

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

Fixed styling on closure example #1405

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/fn/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ example, a closure that captures the x variable:
|val| val + x
```

The syntax and capabilities of closures make them very convenient for
The syntax and capabilities of closures make them very convenient for
on the fly usage. Calling a closure is exactly like calling a function.
However, both input and return types *can* be inferred and input
However, both input and return types *can* be inferred and input
variable names *must* be specified.

Other characteristics of closures include:
Expand All @@ -20,7 +20,7 @@ Other characteristics of closures include:
```rust,editable
fn main() {
// Increment via closures and functions.
fn function (i: i32) -> i32 { i + 1 }
fn function(i: i32) -> i32 { i + 1 }

// Closures are anonymous, here we are binding them to references
// Annotation is identical to function annotation but is optional
Expand Down