summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add')
-rw-r--r--src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock13
-rw-r--r--src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml6
-rw-r--r--src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml8
-rw-r--r--src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs8
-rw-r--r--src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml8
-rw-r--r--src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs3
6 files changed, 46 insertions, 0 deletions
diff --git a/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock
new file mode 100644
index 000000000..a456055c9
--- /dev/null
+++ b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock
@@ -0,0 +1,13 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "add_one"
+version = "0.1.0"
+
+[[package]]
+name = "adder"
+version = "0.1.0"
+dependencies = [
+ "add_one 0.1.0",
+]
+
diff --git a/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml
new file mode 100644
index 000000000..1448801d5
--- /dev/null
+++ b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml
@@ -0,0 +1,6 @@
+[workspace]
+
+members = [
+ "adder",
+ "add_one",
+]
diff --git a/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml
new file mode 100644
index 000000000..900018470
--- /dev/null
+++ b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "add_one"
+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/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs
new file mode 100644
index 000000000..1b4a90c93
--- /dev/null
+++ b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs
@@ -0,0 +1,8 @@
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn it_works() {
+ let result = 2 + 2;
+ assert_eq!(result, 4);
+ }
+}
diff --git a/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml
new file mode 100644
index 000000000..feb3d956e
--- /dev/null
+++ b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "adder"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
+
+add_one = { path = "../add_one" }
diff --git a/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs
new file mode 100644
index 000000000..e7a11a969
--- /dev/null
+++ b/src/doc/book/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}