From eee37d871ee36e0999156823ab08113c5ca863e7 Mon Sep 17 00:00:00 2001 From: Mieridduryn <155842515+Mieridduryn@users.noreply.github.com> Date: Fri, 3 Oct 2025 11:35:50 -0400 Subject: [PATCH] Update ch04-03-fixing-ownership-errors.md Fixed non-monospaced reference to a variable name --- src/ch04-03-fixing-ownership-errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {