From a2ff06e856d19dca5da4582c214c85238500a948 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 5 Jul 2016 15:31:50 +0000 Subject: [PATCH] rebuild pages at ab0e9ab --- ch03-03-functions.html | 4 ++-- print.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ch03-03-functions.html b/ch03-03-functions.html index 5fc35d7a2..3fede068a 100644 --- a/ch03-03-functions.html +++ b/ch03-03-functions.html @@ -139,7 +139,7 @@ fn another_function(x: i32) { type. This is a deliberate decision; we find that requiring type annotations in functions means that you almost never need them anywhere else.

You can separate multiple arguments with a comma:

-
fn NAME(PATTERN, PATTERN, PATTERN, PATTERN...) {
+
fn NAME(PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE...) {
 

Here’s a full example:

fn main() {
@@ -184,7 +184,7 @@ only its parameters are in scope, so we need to use those names. Bindings
 passed as parameters don’t need to have the same name as the arguments.

Return values

Functions can also return values back to the function that called them:

-
fn NAME(PATTERN, PATTERN, PATTERN, PATTERN...) -> TYPE {
+
fn NAME(PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE...) -> TYPE {
 

We don’t name return values, but we do declare their type, after an arrow: ->. Here’s a sample program:

diff --git a/print.html b/print.html index 7a7e8e8b3..4588bc8d7 100644 --- a/print.html +++ b/print.html @@ -966,7 +966,7 @@ fn another_function(x: i32) { type. This is a deliberate decision; we find that requiring type annotations in functions means that you almost never need them anywhere else.

You can separate multiple arguments with a comma:

-
fn NAME(PATTERN, PATTERN, PATTERN, PATTERN...) {
+
fn NAME(PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE...) {
 

Here’s a full example:

fn main() {
@@ -1011,7 +1011,7 @@ only its parameters are in scope, so we need to use those names. Bindings
 passed as parameters don’t need to have the same name as the arguments.

Return values

Functions can also return values back to the function that called them:

-
fn NAME(PATTERN, PATTERN, PATTERN, PATTERN...) -> TYPE {
+
fn NAME(PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE, PATTERN: TYPE...) -> TYPE {
 

We don’t name return values, but we do declare their type, after an arrow: ->. Here’s a sample program: