From 4bbf6d1d1eb4fce9e15ce3de1f4f087ebecbe63d Mon Sep 17 00:00:00 2001 From: chupengfei <450793585@qq.com> Date: Wed, 26 Jun 2024 23:22:27 +0800 Subject: [PATCH] fix: fix variable declaration according to Rust coding guidelines --- src/basic/ownership/ownership.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/ownership/ownership.md b/src/basic/ownership/ownership.md index c5458bf6..104c43ab 100644 --- a/src/basic/ownership/ownership.md +++ b/src/basic/ownership/ownership.md @@ -101,7 +101,7 @@ let s = "hello"; 之前提到过,本章会用 `String` 作为例子,因此这里会进行一下简单的介绍,具体的 `String` 学习请参见 [String 类型](https://course.rs/basic/compound-type/string-slice.html)。 -我们已经见过字符串字面值 `let s ="hello"`,`s` 是被硬编码进程序里的字符串值(类型为 `&str` )。字符串字面值是很方便的,但是它并不适用于所有场景。原因有二: +我们已经见过字符串字面值 `let s = "hello"`,`s` 是被硬编码进程序里的字符串值(类型为 `&str` )。字符串字面值是很方便的,但是它并不适用于所有场景。原因有二: - **字符串字面值是不可变的**,因为被硬编码到程序代码中 - 并非所有字符串的值都能在编写代码时得知