summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move')
-rw-r--r--src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock6
-rw-r--r--src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml6
-rw-r--r--src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs6
3 files changed, 18 insertions, 0 deletions
diff --git a/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock b/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock
new file mode 100644
index 000000000..2aa4918e5
--- /dev/null
+++ b/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml b/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml
new file mode 100644
index 000000000..e8847526d
--- /dev/null
+++ b/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
diff --git a/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs b/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs
new file mode 100644
index 000000000..a5817e714
--- /dev/null
+++ b/src/doc/book/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ // ANCHOR: here
+ let s1 = String::from("hello");
+ let s2 = s1;
+ // ANCHOR_END: here
+}