From 9cc88fb9ee8d4dfd017b76b37d09802d16726487 Mon Sep 17 00:00:00 2001 From: smol <107521333+a-tiny-kirin@users.noreply.github.com> Date: Sun, 16 Jun 2024 03:44:33 +0000 Subject: [PATCH] (automated) deploy from commit ba80bae6e4d491826251811fe9b65287cad2de53 --- src/wiwi/with_cloned/mod.rs.html | 48 ++++++++++++++++++++----- wiwi/index.html | 2 +- wiwi/macro.with_cloned.html | 5 ++- wiwi/with_cloned/index.html | 2 +- wiwi/with_cloned/macro.with_cloned.html | 5 ++- 5 files changed, 45 insertions(+), 17 deletions(-) diff --git a/src/wiwi/with_cloned/mod.rs.html b/src/wiwi/with_cloned/mod.rs.html index 43fc003f1..8da5a1bf4 100644 --- a/src/wiwi/with_cloned/mod.rs.html +++ b/src/wiwi/with_cloned/mod.rs.html @@ -169,6 +169,21 @@ 169 170 171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186
/// Executes code with cloned values, so the executed code
/// can take ownership of the value without moving the original
///
@@ -329,15 +344,30 @@
/// ```
#[macro_export]
macro_rules! with_cloned {
- { mut $($thing:ident),+ in $($stuff:tt)* } => {{
- $(#[allow(unused_mut)] let mut $thing = ::std::clone::Clone::clone(&$thing);)+
- $($stuff)+
- }};
-
- { $($thing:ident),+ in $($stuff:tt)* } => {{
- $(#[allow(unused_mut)] let $thing = ::std::clone::Clone::clone(&$thing);)+
- $($stuff)+
- }};
+ ($($stuff:tt)*) => {
+ // hide potential distracting implementation detail in docs
+ $crate::with_cloned::_with_cloned_impl! { $($stuff)* }
+ }
}
pub use with_cloned;
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _with_cloned_impl {
+ { mut $($thing:ident),+ in $($stuff:tt)* } => {
+ {
+ $(#[allow(unused_mut)] let mut $thing = ::std::clone::Clone::clone(&$thing);)+
+ $($stuff)+
+ }
+ };
+
+ { $($thing:ident),+ in $($stuff:tt)* } => {
+ {
+ $(let $thing = ::std::clone::Clone::clone(&$thing);)+
+ $($stuff)+
+ }
+ };
+}
+#[doc(hidden)]
+pub use _with_cloned_impl;