Example: New Files

In this page, we introduce new files to the Gitorial: Cargo.toml and src/main.rs.

These come from cargo init.

You can see how the mdBook renders that new content, and shows a diff of the new files.

[package]
name = "rust-state-machine"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fn main() {
    println!("Hello, world!");
}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..400485bd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+**/target/
+.DS_Store
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 00000000..75fe297f
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "rust-state-machine"
+version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 00000000..c7fe36cd
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "rust-state-machine"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 00000000..e7a11a96
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello, world!");
+}