Skip to content

Commit

Permalink
(automated) deploy from commit ba80bae
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tiny-kirin committed Jun 16, 2024
1 parent b9337c8 commit 9cc88fb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 17 deletions.
48 changes: 39 additions & 9 deletions src/wiwi/with_cloned/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@
<a href="#169" id="169">169</a>
<a href="#170" id="170">170</a>
<a href="#171" id="171">171</a>
<a href="#172" id="172">172</a>
<a href="#173" id="173">173</a>
<a href="#174" id="174">174</a>
<a href="#175" id="175">175</a>
<a href="#176" id="176">176</a>
<a href="#177" id="177">177</a>
<a href="#178" id="178">178</a>
<a href="#179" id="179">179</a>
<a href="#180" id="180">180</a>
<a href="#181" id="181">181</a>
<a href="#182" id="182">182</a>
<a href="#183" id="183">183</a>
<a href="#184" id="184">184</a>
<a href="#185" id="185">185</a>
<a href="#186" id="186">186</a>
</pre></div><pre class="rust"><code><span class="doccomment">/// Executes code with cloned values, so the executed code
/// can take ownership of the value without moving the original
///
Expand Down Expand Up @@ -329,15 +344,30 @@
/// ```
</span><span class="attr">#[macro_export]
</span><span class="macro">macro_rules!</span> with_cloned {
{ <span class="kw-2">mut </span>$(<span class="macro-nonterminal">$thing</span>:ident),+ <span class="kw">in </span>$(<span class="macro-nonterminal">$stuff</span>:tt)* } =&gt; {{
$(<span class="attr">#[allow(unused_mut)] </span><span class="kw">let </span><span class="kw-2">mut </span><span class="macro-nonterminal">$thing </span>= ::std::clone::Clone::clone(<span class="kw-2">&amp;</span><span class="macro-nonterminal">$thing</span>);)+
$(<span class="macro-nonterminal">$stuff</span>)+
}};

{ $(<span class="macro-nonterminal">$thing</span>:ident),+ <span class="kw">in </span>$(<span class="macro-nonterminal">$stuff</span>:tt)* } =&gt; {{
$(<span class="attr">#[allow(unused_mut)] </span><span class="kw">let </span><span class="macro-nonterminal">$thing </span>= ::std::clone::Clone::clone(<span class="kw-2">&amp;</span><span class="macro-nonterminal">$thing</span>);)+
$(<span class="macro-nonterminal">$stuff</span>)+
}};
($(<span class="macro-nonterminal">$stuff</span>:tt)<span class="kw-2">*</span>) =&gt; {
<span class="comment">// hide potential distracting implementation detail in docs
</span><span class="macro-nonterminal">$</span><span class="macro">crate::with_cloned::_with_cloned_impl!</span> { $(<span class="macro-nonterminal">$stuff</span>)* }
}
}
<span class="kw">pub use </span>with_cloned;

<span class="attr">#[doc(hidden)]
#[macro_export]
</span><span class="macro">macro_rules!</span> _with_cloned_impl {
{ <span class="kw-2">mut </span>$(<span class="macro-nonterminal">$thing</span>:ident),+ <span class="kw">in </span>$(<span class="macro-nonterminal">$stuff</span>:tt)* } =&gt; {
{
$(<span class="attr">#[allow(unused_mut)] </span><span class="kw">let </span><span class="kw-2">mut </span><span class="macro-nonterminal">$thing </span>= ::std::clone::Clone::clone(<span class="kw-2">&amp;</span><span class="macro-nonterminal">$thing</span>);)+
$(<span class="macro-nonterminal">$stuff</span>)+
}
};

{ $(<span class="macro-nonterminal">$thing</span>:ident),+ <span class="kw">in </span>$(<span class="macro-nonterminal">$stuff</span>:tt)* } =&gt; {
{
$(<span class="kw">let </span><span class="macro-nonterminal">$thing </span>= ::std::clone::Clone::clone(<span class="kw-2">&amp;</span><span class="macro-nonterminal">$thing</span>);)+
$(<span class="macro-nonterminal">$stuff</span>)+
}
};
}
<span class="attr">#[doc(hidden)]
</span><span class="kw">pub use </span>_with_cloned_impl;
</code></pre></div></section></main></body></html>
2 changes: 1 addition & 1 deletion wiwi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h3 id="enabled-features-wiwikiwingay"><a class="doc-anchor" href="#enabled-feat
<li><code>with-cloned (unstable)</code></li>
<li><code>z85</code></li>
</ul>
<p>These docs have been built from commit <a href="https://github.com/meadowsys/wiwi/commit/9739ab53aac5e4846ee27ab87c836517da573c3e">9739ab53</a>.</p>
<p>These docs have been built from commit <a href="https://github.com/meadowsys/wiwi/commit/ba80bae6e4d491826251811fe9b65287cad2de53">ba80bae6</a>.</p>
<div class="footnotes"><hr><ol><li id="fn1"><p>Based on the benchmark available in this repo: wiwi is about 21.5x faster in encode, and 7.5x faster in decode. I want better benchmarks though. For now the <code>hex</code> crate also provides more flexibility, whereas <code>wiwi::hex</code> just exposes <code>encode_hex</code>, <code>encode_upper_hex</code>, and <code>decode_hex</code> functions.
&nbsp;<a href="#fnref1"></a></p></li><li id="fn2"><p>Based on the benchmark available in this repo: wiwi is about 1.4x faster in encode, and 2.2x faster in decode. I want better benchmarks though. There is no functionality that the <code>z85</code> crate provides, that we don’t also provide (<code>encode_z85</code> and <code>decode_z85</code> functions).&nbsp;<a href="#fnref2"></a></p></li></ol></div></div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="aoc/index.html" title="mod wiwi::aoc">aoc</a><span class="stab portability" title="Available on crate feature `aoc-unstable` only"><code>aoc-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="auth/index.html" title="mod wiwi::auth">auth</a><span class="stab portability" title="Available on crate feature `auth-unstable` only"><code>auth-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="bitstream/index.html" title="mod wiwi::bitstream">bitstream</a><span class="stab portability" title="Available on crate feature `bitstream-unstable` only"><code>bitstream-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="chainer/index.html" title="mod wiwi::chainer">chainer</a><span class="stab portability" title="Available on crate feature `chainer-unstable` only"><code>chainer-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="clock_timer/index.html" title="mod wiwi::clock_timer">clock_timer</a><span class="stab portability" title="Available on crate feature `clock-timer` only"><code>clock-timer</code></span></div><div class="desc docblock-short">An interval tracking clock</div></li><li><div class="item-name"><a class="mod" href="debounce/index.html" title="mod wiwi::debounce">debounce</a><span class="stab portability" title="Available on crate feature `debounce` only"><code>debounce</code></span></div><div class="desc docblock-short">A debounced function; or a function that won’t actually get called until
there haven’t been calls to it for a certain amount of time.</div></li><li><div class="item-name"><a class="mod" href="defer/index.html" title="mod wiwi::defer">defer</a><span class="stab portability" title="Available on crate feature `defer-unstable` only"><code>defer-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="h/index.html" title="mod wiwi::h">h</a><span class="stab portability" title="Available on crate feature `h` only"><code>h</code></span></div><div class="desc docblock-short">h</div></li><li><div class="item-name"><a class="mod" href="hex/index.html" title="mod wiwi::hex">hex</a><span class="stab portability" title="Available on crate feature `hex` only"><code>hex</code></span></div><div class="desc docblock-short">Fast and efficient implementation of hex encoding.</div></li><li><div class="item-name"><a class="mod" href="id/index.html" title="mod wiwi::id">id</a><span class="stab portability" title="Available on crate feature `id-unstable` only"><code>id-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="int/index.html" title="mod wiwi::int">int</a><span class="stab portability" title="Available on crate feature `int-unstable` only"><code>int-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="iter/index.html" title="mod wiwi::iter">iter</a><span class="stab portability" title="Available on crate feature `iter-unstable` only"><code>iter-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="lazy_wrap/index.html" title="mod wiwi::lazy_wrap">lazy_wrap</a><span class="stab portability" title="Available on crate feature `lazy-wrap` only"><code>lazy-wrap</code></span></div><div class="desc docblock-short">Wrapper for initialisation function, initialising it only on first access.</div></li><li><div class="item-name"><a class="mod" href="lsl/index.html" title="mod wiwi::lsl">lsl</a><span class="stab portability" title="Available on crate feature `lsl-unstable` only"><code>lsl-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="memory_usage/index.html" title="mod wiwi::memory_usage">memory_usage</a><span class="stab portability" title="Available on crate feature `memory-usage-unstable` only"><code>memory-usage-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="minesweeper/index.html" title="mod wiwi::minesweeper">minesweeper</a><span class="stab portability" title="Available on crate feature `minesweeper-unstable` only"><code>minesweeper-unstable</code></span></div></li><li><div class="item-name"><a class="mod" href="nominal/index.html" title="mod wiwi::nominal">nominal</a><span class="stab portability" title="Available on crate feature `nominal` only"><code>nominal</code></span></div><div class="desc docblock-short">Generic, zero-cost struct that wraps data in a newtype, to take advantage of
Expand Down
5 changes: 2 additions & 3 deletions wiwi/macro.with_cloned.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Executes code with cloned values, so the executed code can take ownership of the value without moving the original"><title>with_cloned in wiwi - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="wiwi" data-themes="meadow" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ab14f944a 2024-05-13)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../wiwi/index.html">wiwi</a><span class="version">0.8.0</span></h2></div><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Macro <a href="index.html">wiwi</a>::<wbr><a class="macro" href="#">with_cloned</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/wiwi/with_cloned/mod.rs.html#160-170">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><span class="macro">macro_rules!</span> with_cloned {
{ <span class="kw-2">mut </span>$(<span class="macro-nonterminal">$thing</span>:ident),+ <span class="kw">in </span>$(<span class="macro-nonterminal">$stuff</span>:tt)* } =&gt; { ... };
{ $(<span class="macro-nonterminal">$thing</span>:ident),+ <span class="kw">in </span>$(<span class="macro-nonterminal">$stuff</span>:tt)* } =&gt; { ... };
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Executes code with cloned values, so the executed code can take ownership of the value without moving the original"><title>with_cloned in wiwi - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="wiwi" data-themes="meadow" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ab14f944a 2024-05-13)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../wiwi/index.html">wiwi</a><span class="version">0.8.0</span></h2></div><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Macro <a href="index.html">wiwi</a>::<wbr><a class="macro" href="#">with_cloned</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/wiwi/with_cloned/mod.rs.html#160-165">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><span class="macro">macro_rules!</span> with_cloned {
($(<span class="macro-nonterminal">$stuff</span>:tt)<span class="kw-2">*</span>) =&gt; { ... };
}</pre><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>with-cloned-unstable</code></strong> only.</div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Executes code with cloned values, so the executed code
can take ownership of the value without moving the original</p>
<p>Read on if you want to know why I wrote this smol macro and what problems
Expand Down
Loading

0 comments on commit 9cc88fb

Please sign in to comment.