diff --git a/src/ch04-03-fixing-ownership-errors.md b/src/ch04-03-fixing-ownership-errors.md index 9c5064abd2..af39d7c2a6 100644 --- a/src/ch04-03-fixing-ownership-errors.md +++ b/src/ch04-03-fixing-ownership-errors.md @@ -93,7 +93,7 @@ fn main() { In this example, a reference `first` to `name[0]` is created before calling `stringify_name_with_title`. The function `name.push(..)` reallocates the contents of `name`, which invalidates `first`, causing the `println` to read deallocated memory. -So how do we fix this API? One straightforward solution is to change the type of name from `&Vec` to `&mut Vec`: +So how do we fix this API? One straightforward solution is to change the type of `name` from `&Vec` to `&mut Vec`: ```rust,ignore fn stringify_name_with_title(name: &mut Vec) -> String {