From 4ebe3f263eb8321676dbb544f128ff3f1071f9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E8=A7=85?= Date: Fri, 9 Oct 2026 22:16:17 +0800 Subject: [PATCH] 123456 --- .gitignore | 22 ++++++++++++++++++++++ rust_docs/00初始化项目.md | 12 ++++++++++++ rust_docs/01语法.md | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .gitignore create mode 100644 rust_docs/00初始化项目.md create mode 100644 rust_docs/01语法.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d287c2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Build and Release Folders +bin-debug/ +bin-release/ +[Oo]bj/ +[Bb]in/ + +# Executables +*.swf +*.air +*.ipa +*.apk +*.log +*.exe +*.lock +logs/ +# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` +# should NOT be excluded as they contain compiler settings and other important +# information for Eclipse / Flash Builder. + +# 忽略名为__pycache__的目录及其所有内target/ +*/node_modules/ +*/target/ \ No newline at end of file diff --git a/rust_docs/00初始化项目.md b/rust_docs/00初始化项目.md new file mode 100644 index 0000000..a2b3a35 --- /dev/null +++ b/rust_docs/00初始化项目.md @@ -0,0 +1,12 @@ +# https://colobu.com/rust100/ + + +## 创建Rust项目 +```bash +cargo new my_rust_project +cd my_rust_project +``` +## 运行与调试项目 +```bash +cargo run +``` \ No newline at end of file diff --git a/rust_docs/01语法.md b/rust_docs/01语法.md new file mode 100644 index 0000000..366360c --- /dev/null +++ b/rust_docs/01语法.md @@ -0,0 +1,17 @@ +# 参考文档 https://colobu.com/rust100/ + +## 注释 +```rust +// rust中的注释也是 // + +``` + +## 函数 +```rust +// `fn` ( ) -> { } +fn greeting() -> &'static str { + // TODO: fix me 👇 + "I'm ready to __!" +} +``` +- greeting没有输入参数,返回一个字符串切片引用(&'static str)。 \ No newline at end of file