about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2017-04-01 19:33:45 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2017-04-12 17:21:15 -0700
commit7ec27ae63d762234ad768fb605bd40bbbc52c7a0 (patch)
tree932053cae56ba36ac896ffdfdf6a38e01b83f5b9 /src/doc
parent44855a4cef3e83c76c386fdcf034447a8ee128e4 (diff)
downloadrust-7ec27ae63d762234ad768fb605bd40bbbc52c7a0.tar.gz
rust-7ec27ae63d762234ad768fb605bd40bbbc52c7a0.zip
Add ToOwned::clone_into (unstable as toowned_clone_into)
to_owned generalizes clone; this generalizes clone_from.  Use to_owned to
give it a default impl.  Customize the impl for [T], str, and T:Clone.

Use it in Cow::clone_from to reuse resources when cloning Owned into Owned.
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/unstable-book/src/SUMMARY.md1
-rw-r--r--src/doc/unstable-book/src/toowned-clone-into.md7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/SUMMARY.md b/src/doc/unstable-book/src/SUMMARY.md
index 9ce097e78a4..2e9810c438d 100644
--- a/src/doc/unstable-book/src/SUMMARY.md
+++ b/src/doc/unstable-book/src/SUMMARY.md
@@ -193,6 +193,7 @@
 - [thread_local](thread-local.md)
 - [thread_local_internals](thread-local-internals.md)
 - [thread_local_state](thread-local-state.md)
+- [toowned_clone_into](toowned-clone-into.md)
 - [trace_macros](trace-macros.md)
 - [trusted_len](trusted-len.md)
 - [try_from](try-from.md)
diff --git a/src/doc/unstable-book/src/toowned-clone-into.md b/src/doc/unstable-book/src/toowned-clone-into.md
new file mode 100644
index 00000000000..eccc7e0e4dd
--- /dev/null
+++ b/src/doc/unstable-book/src/toowned-clone-into.md
@@ -0,0 +1,7 @@
+# `toowned_clone_into`
+
+The tracking issue for this feature is: [#41263]
+
+[#41263]: https://github.com/rust-lang/rust/issues/41263
+
+------------------------