hello_world 1~2

This commit is contained in:
Shikong 2022-06-26 15:01:16 +08:00
parent efae9dc3a4
commit ce0dcefe6d
4 changed files with 26 additions and 4 deletions

9
.gitignore vendored
View File

@ -1,12 +1,13 @@
### Rust template
# Generated by Cargo
# will have compiled files and executables
debug/
target/
**/debug/
**/target/
**/*.exe
**/*.pdb
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
**/Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

7
1.hello_world/main.rs Normal file
View File

@ -0,0 +1,7 @@
// 编译
// rustc ./main.rs
// 主函数入口
fn main() {
println!("Hello World");
}

8
2.hello_cargo/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "hello_cargo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -0,0 +1,6 @@
// Cargo 创建项目
// cargo new hello_cargo
fn main() {
println!("Hello, world!");
}