From 363ed2f7adf8a1c17befda0a7d0a3bfbc3bdf435 Mon Sep 17 00:00:00 2001 From: Matt Windsor Date: Sat, 6 Dec 2014 00:30:03 +0000 Subject: [PATCH] Correct minor typos on the ownership guide. liftimes -> lifetimes --- src/doc/guide-ownership.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/guide-ownership.md b/src/doc/guide-ownership.md index c1180f7e6a9..06fe0652519 100644 --- a/src/doc/guide-ownership.md +++ b/src/doc/guide-ownership.md @@ -231,7 +231,7 @@ fn add_one(num: &int) -> int { Rust has a feature called 'lifetime elision,' which allows you to not write lifetime annotations in certain circumstances. This is one of them. Without -eliding the liftimes, `add_one` looks like this: +eliding the lifetimes, `add_one` looks like this: ```rust fn add_one<'a>(num: &'a int) -> int { @@ -254,7 +254,7 @@ This part _declares_ our lifetimes. This says that `add_one` has one lifetime, fn add_two<'a, 'b>(...) ``` -Then in our parameter list, we use the liftimes we've named: +Then in our parameter list, we use the lifetimes we've named: ```{rust,ignore} ...(num: &'a int) -> ... @@ -279,7 +279,7 @@ fn main() { } ``` -As you can see, `struct`s can also have liftimes. In a similar way to functions, +As you can see, `struct`s can also have lifetimes. In a similar way to functions, ```{rust} struct Foo<'a> { @@ -295,7 +295,7 @@ x: &'a int, # } ``` -uses it. So why do we need a liftime here? We need to ensure that any reference +uses it. So why do we need a lifetime here? We need to ensure that any reference to a `Foo` cannot outlive the reference to an `int` it contains. ## Thinking in scopes