Skip to content

Commit 9ecdc18

Browse files
committed
deploy: 6c807cb
1 parent f0ba24b commit 9ecdc18

File tree

4 files changed

+24
-26
lines changed

4 files changed

+24
-26
lines changed

mem/global_static.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,18 @@ <h2 id="declare-lazily-evaluated-constant"><a class="header" href="#declare-lazi
189189
}</code></pre></pre>
190190
<h2 id="stdcell"><a class="header" href="#stdcell">Std:cell</a></h2>
191191
<p><a href="https://doc.rust-lang.org/beta/std/cell/struct.OnceCell.html"><code>OnceCell</code></a> is included in the standard library as an alternative.</p>
192-
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">#![allow(unused)]
193-
</span><span class="boring">fn main() {
194-
</span>use std::cell::OnceCell;
195-
196-
let cell = OnceCell::new();
197-
assert!(cell.get().is_none());
198-
199-
let value: &amp;String = cell.get_or_init(|| {
200-
"Hello, World!".to_string()
201-
});
202-
assert_eq!(value, "Hello, World!");
203-
assert!(cell.get().is_some());
204-
<span class="boring">}</span></code></pre></pre>
192+
<pre><pre class="playground"><code class="language-rust edition2021">use std::cell::OnceCell;
193+
194+
fn main() {
195+
let cell = OnceCell::new();
196+
assert!(cell.get().is_none());
197+
198+
let value: &amp;String = cell.get_or_init(|| {
199+
"Hello, World!".to_string()
200+
});
201+
assert_eq!(value, "Hello, World!");
202+
assert!(cell.get().is_some());
203+
}</code></pre></pre>
205204
<!--
206205
Links, in a few categories. Follow the existing structure.
207206
Keep lines sorted.

print.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3935,19 +3935,18 @@ <h2 id="declare-lazily-evaluated-constant"><a class="header" href="#declare-lazi
39353935
}</code></pre></pre>
39363936
<h2 id="stdcell"><a class="header" href="#stdcell">Std:cell</a></h2>
39373937
<p><a href="https://doc.rust-lang.org/beta/std/cell/struct.OnceCell.html"><code>OnceCell</code></a> is included in the standard library as an alternative.</p>
3938-
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">#![allow(unused)]
3939-
</span><span class="boring">fn main() {
3940-
</span>use std::cell::OnceCell;
3938+
<pre><pre class="playground"><code class="language-rust edition2021">use std::cell::OnceCell;
39413939

3942-
let cell = OnceCell::new();
3943-
assert!(cell.get().is_none());
3940+
fn main() {
3941+
let cell = OnceCell::new();
3942+
assert!(cell.get().is_none());
39443943

3945-
let value: &amp;String = cell.get_or_init(|| {
3946-
"Hello, World!".to_string()
3947-
});
3948-
assert_eq!(value, "Hello, World!");
3949-
assert!(cell.get().is_some());
3950-
<span class="boring">}</span></code></pre></pre>
3944+
let value: &amp;String = cell.get_or_init(|| {
3945+
"Hello, World!".to_string()
3946+
});
3947+
assert_eq!(value, "Hello, World!");
3948+
assert!(cell.get().is_some());
3949+
}</code></pre></pre>
39513950
<!--
39523951
Links, in a few categories. Follow the existing structure.
39533952
Keep lines sorted.

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)