From 16b50cd1dde8ab45b170bf2339c622a03a9506e6 Mon Sep 17 00:00:00 2001 From: Corning Sun Date: Thu, 14 Nov 2024 14:04:22 +0800 Subject: [PATCH] Update char-bool.md `std::mem::size_of_val(&x))` can be simplified to `std::mem::` --- src/basic/base-type/char-bool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/base-type/char-bool.md b/src/basic/base-type/char-bool.md index af5ad612..788efcd8 100644 --- a/src/basic/base-type/char-bool.md +++ b/src/basic/base-type/char-bool.md @@ -24,7 +24,7 @@ fn main() { ```rust fn main() { let x = '中'; - println!("字符'中'占用了{}字节的内存大小",std::mem::size_of_val(&x)); + println!("字符'中'占用了{}字节的内存大小", size_of_val(&x)); } ```