From adafceb66abd88c16ca0c04e0c807ec4672f1b10 Mon Sep 17 00:00:00 2001 From: Hector PENG Date: Wed, 6 May 2026 11:54:48 +0800 Subject: [PATCH] Updated 'src/generic_types_traits_and_lifetimes/lifetimes.md'. --- src/generic_types_traits_and_lifetimes/lifetimes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic_types_traits_and_lifetimes/lifetimes.md b/src/generic_types_traits_and_lifetimes/lifetimes.md index 2eb28a5..ed0e554 100644 --- a/src/generic_types_traits_and_lifetimes/lifetimes.md +++ b/src/generic_types_traits_and_lifetimes/lifetimes.md @@ -516,7 +516,7 @@ where } ``` -这是 [清单 10-21](#listing_10-21) 中的 `longest` 函数,返回两个字符串切片中较长的那个。但现在他有个名为 `ann` 的泛型类型 `T` 的额外参数,可以由任何实现 `where` 子句所指定的 `Display` 特质的类型填入。这个额外参数将使用 `{}` 打印出来,这就是为何 `Display` 特质边界是必要的。由与生命周期属于泛型类型,所以生命周期参数 `'a` 与泛型类型参数 `T` 的声明位于函数名字之后尖括号内的同一列表中。 +这是 [清单 10-21](#listing_10-21) 中的 `longest` 函数,返回两个字符串切片中较长的那个。但现在他有个名为 `ann` 的泛型类型 `T` 的额外参数,可以由任何实现 `where` 子句所指定的 `Display` 特质的类型填入。这个额外参数将使用 `{}` 打印出来,这就是为何 `Display` 特质边界是必要的。由于生命周期属于泛型类型,所以生命周期参数 `'a` 与泛型类型参数 `T` 的声明位于函数名字之后尖括号内的同一列表中。 # 本章小结