hello_world 1~2
This commit is contained in:
parent
efae9dc3a4
commit
ce0dcefe6d
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,12 +1,13 @@
|
|||||||
### Rust template
|
### Rust template
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
debug/
|
**/debug/
|
||||||
target/
|
**/target/
|
||||||
|
**/*.exe
|
||||||
|
**/*.pdb
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# 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
|
# 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
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
7
1.hello_world/main.rs
Normal file
7
1.hello_world/main.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// 编译
|
||||||
|
// rustc ./main.rs
|
||||||
|
|
||||||
|
// 主函数入口
|
||||||
|
fn main() {
|
||||||
|
println!("Hello World");
|
||||||
|
}
|
8
2.hello_cargo/Cargo.toml
Normal file
8
2.hello_cargo/Cargo.toml
Normal 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]
|
6
2.hello_cargo/src/main.rs
Normal file
6
2.hello_cargo/src/main.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// Cargo 创建项目
|
||||||
|
// cargo new hello_cargo
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user