From 870c198982f33e42e8238288aaa8d4557a3e5fdd Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Jan 2022 10:40:59 +0800 Subject: [PATCH] save --- exercise/exercises/functions/README.md | 6 +++--- exercise/exercises/functions/functions1.rs | 3 ++- exercise/exercises/functions/functions2.rs | 3 ++- exercise/info.toml | 10 ++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/exercise/exercises/functions/README.md b/exercise/exercises/functions/README.md index 66547bd4..8e7cf63c 100644 --- a/exercise/exercises/functions/README.md +++ b/exercise/exercises/functions/README.md @@ -1,7 +1,7 @@ -# Functions +# 函数(Functions) -Here, you'll learn how to write functions and how Rust's compiler can trace things way back. +在本练习,你将学习如何编写一个函数,以及 Rust 的编译器怎样对事物进行追溯(way back)。 -## Further information +## 更多信息 - [How Functions Work](https://doc.rust-lang.org/book/ch03-03-how-functions-work.html) diff --git a/exercise/exercises/functions/functions1.rs b/exercise/exercises/functions/functions1.rs index 31125278..f18825d9 100644 --- a/exercise/exercises/functions/functions1.rs +++ b/exercise/exercises/functions/functions1.rs @@ -1,8 +1,9 @@ // functions1.rs -// Make me compile! Execute `rustlings hint functions1` for hints :) +// 让我能够编译!执行 `rustex hint functions1` 获取提示 :) // I AM NOT DONE +/// 翻译: [mg-chao](https://github.com/mg-chao) fn main() { call_me(); } diff --git a/exercise/exercises/functions/functions2.rs b/exercise/exercises/functions/functions2.rs index 5721a172..915ebec1 100644 --- a/exercise/exercises/functions/functions2.rs +++ b/exercise/exercises/functions/functions2.rs @@ -1,8 +1,9 @@ // functions2.rs -// Make me compile! Execute `rustlings hint functions2` for hints :) +// 让我能够编译!执行 `rustex hint functions2` 获取提示 :) // I AM NOT DONE +/// 翻译: [mg-chao](https://github.com/mg-chao) fn main() { call_me(3); } diff --git a/exercise/info.toml b/exercise/info.toml index 38e271e8..dca534de 100644 --- a/exercise/info.toml +++ b/exercise/info.toml @@ -78,18 +78,16 @@ name = "functions1" path = "exercises/functions/functions1.rs" mode = "compile" hint = """ -This main function is calling a function that it expects to exist, but the -function doesn't exist. It expects this function to have the name `call_me`. -It expects this function to not take any arguments and not return a value. -Sounds a lot like `main`, doesn't it?""" +主函数中正试图调用一个名为 `call_me` 的函数,可这个函数并不存在。 +它希望这个函数不接受任何参数,同时也不返回值。 +听起来很像 `main` 函数,不是吗?""" [[exercises]] name = "functions2" path = "exercises/functions/functions2.rs" mode = "compile" hint = """ -Rust requires that all parts of a function's signature have type annotations, -but `call_me` is missing the type annotation of `num`.""" + Rust 要求函数签名有类型标注,但是 `call_me` 函数缺少 `num` 的类型注明。""" [[exercises]] name = "functions3"