From 3181ddfe81d08d30131de4ca6b8fa751be7781c3 Mon Sep 17 00:00:00 2001 From: Rustln Date: Mon, 21 Mar 2022 16:44:06 +0800 Subject: [PATCH] Fixed typo. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这里应该是手误,`u32` 不能和 `i32` 进行相加,必须是同类型。 --- src/advance/into-types/custom-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advance/into-types/custom-type.md b/src/advance/into-types/custom-type.md index 09700815..b837a1a8 100644 --- a/src/advance/into-types/custom-type.md +++ b/src/advance/into-types/custom-type.md @@ -110,7 +110,7 @@ type Meters = u32 **类型别名并不是一个独立的全新的类型,而是某一个类型的别名**,因此编译器依然会把 `Meters` 当 `u32` 来使用: ```rust -type Meters = i32; +type Meters = u32; let x: u32 = 5; let y: Meters = 5;