From 082b01db951bcfca1ead96d148601cfedcbbdace Mon Sep 17 00:00:00 2001 From: gfrancesco Date: Thu, 22 Jul 2021 15:02:39 +0200 Subject: [PATCH] Clarify the meaning of a sentence in ch10-03 I'm new to Rust and reading the original sentence made me wonder if we need `Display` because the parameter is printed before the comparison or just because it is printed. It's a small thing and maybe not so critical, hope I got it right. --- src/ch10-03-lifetime-syntax.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ch10-03-lifetime-syntax.md b/src/ch10-03-lifetime-syntax.md index 6cec3799e..16d3b46f9 100644 --- a/src/ch10-03-lifetime-syntax.md +++ b/src/ch10-03-lifetime-syntax.md @@ -588,10 +588,11 @@ This is the `longest` function from Listing 10-22 that returns the longer of two string slices. But now it has an extra parameter named `ann` of the generic type `T`, which can be filled in by any type that implements the `Display` trait as specified by the `where` clause. This extra parameter will be printed -before the function compares the lengths of the string slices, which is why the -`Display` trait bound is necessary. Because lifetimes are a type of generic, -the declarations of the lifetime parameter `'a` and the generic type parameter -`T` go in the same list inside the angle brackets after the function name. +using `{}`, which is why the `Display` trait bound is necessary. The `ann` +parameter is printed before the function compares the lengths of the string slices. +Because lifetimes are a type of generic, the declarations of the lifetime parameter +`'a` and the generic type parameter `T` go in the same list inside the angle brackets +after the function name. ## Summary