mirror of
https://github.com/Noratrieb/blog.git
synced 2026-01-14 20:35:02 +01:00
deploy: 00ea220024
This commit is contained in:
parent
b71112af4c
commit
a6632cc8ef
12 changed files with 45 additions and 8 deletions
|
|
@ -126,6 +126,8 @@ So far we’ve just used tuples. But we can go even further. Structs of stru
|
|||
</span></span></code></pre></div><p>If it weren’t for <code>fn main</code> starting a strike and stopping compilation, this would have worked! Quite bold of <code>fn main</code> to just start a strike, even though there’s no <code>union</code> in the entire program. But we really need it, it’s not a disposable worker.</p><p>And then, last and least I want to highlight one of my favourite consequences of this: <code>struct else</code></p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-rust data-lang=rust><span style=display:flex><span><span style=color:#66d9ef>struct</span> Some(Test) <span style=color:#f92672>=</span> None <span style=color:#66d9ef>else</span> {
|
||||
</span></span><span style=display:flex><span> compile_error!(<span style=color:#e6db74>"didn't match pattern"</span>);
|
||||
</span></span><span style=display:flex><span>};
|
||||
</span></span></code></pre></div><p>you’re asking yourself what you just read. meanwhile, i am asking myself what i just wrote. we are very similar.</p></div></div><div class=pagination><div class=pagination__title><span class=pagination__title-h></span><hr></div><div class=pagination__buttons><span class="button next"><a href=/posts/box-is-a-unique-type/><span class=button__text>Box Is a Unique Type</span>
|
||||
</span></span></code></pre></div><p>you’re asking yourself what you just read. meanwhile, i am asking myself what i just wrote. we are very similar.</p></div></div><div class=pagination><div class=pagination__title><span class=pagination__title-h></span><hr></div><div class=pagination__buttons><span class="button previous"><a href=/posts/the-inevitable-doom/><span class=button__icon>←</span>
|
||||
<span class=button__text>The Inevitable Doom</span>
|
||||
</a></span><span class="button next"><a href=/posts/box-is-a-unique-type/><span class=button__text>Box Is a Unique Type</span>
|
||||
<span class=button__icon>→</span></a></span></div></div></div></div><footer class=footer><div class=footer__inner><div class=copyright><span>© 2024 Powered by <a href=http://gohugo.io>Hugo</a></span>
|
||||
<span>:: Theme made by <a href=https://twitter.com/panr>panr</a></span></div></div></footer><script src=/assets/main.js></script><script src=/assets/prism.js></script></div></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue