<p>Hello and welcome to another issue of <em>This Week in Rust</em>!
<a href="http://rust-lang.org">Rust</a> is a programming language empowering everyone to build reliable and efficient software.
This is a weekly summary of its progress and community.
Want something mentioned? Tweet us at <a href="https://twitter.com/ThisWeekInRust">@ThisWeekInRust</a> or <a href="https://github.com/rust-lang/this-week-in-rust">send us a pull request</a>.
Want to get involved? <a href="https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md">We love contributions</a>.</p>
<p><em>This Week in Rust</em> is openly developed <a href="https://github.com/rust-lang/this-week-in-rust">on GitHub</a>.
If you find any errors in this week's issue, <a href="https://github.com/rust-lang/this-week-in-rust/pulls">please submit a PR</a>.</p>
<h2 id="updates-from-rust-community">Updates from Rust Community</h2>
<h3 id="official">Official</h3>
<ul>
<li><a href="https://blog.rust-lang.org/inside-rust/2021/11/25/in-response-to-the-moderation-team-resignation.html">In response to the moderation team resignation</a></li>
<li><a href="https://www.ralfj.de/blog/2021/11/24/ub-necessary.html">Do we Really Need Undefined Behavior?</a></li>
<li><a href="https://matklad.github.io//2021/11/27/notes-on-module-system.html">Notes On Module System</a></li>
<li><a href="https://njk.onl/blog/gaffer.html">A prioritised micro-batch scheduler in rust</a></li>
<li><a href="https://dev.to/mark_saward/go-footguns-go-defer-and-rust-drop-17af">Go footguns: Go Defer and Rust Drop</a></li>
<li><a href="https://blog.yossarian.net/2021/11/29/LLVM-internals-part-4-attributes-and-attribute-groups">LLVM internals, part 4: attributes and attribute groups</a></li>
<li><a href="https://eevans.co/blog/wraft/">Implementing Raft for Browsers with Rust and WebRTC</a></li>
<li><a href="https://oxide.computer/blog/hubris-and-humility">Hubris and Humility</a></li>
<li>[ZH] <a href="https://dev.to/daniel1in/zero-cost-abstractions-in-rust-5e41">Zero-Cost Abstractions in Rust</a></li>
<li>[audio] <a href="https://rustacean-station.org/episode/048-herbert-wolverson/">Game Development with Herbert Wolverson</a></li>
<li>[video] <a href="https://www.youtube.com/watch?v=bejThbzAYOA">Rust Linz, November 2021 - Advent of Code by Rainer Stropek with Fred Morcos</a></li>
<li>[video] <a href="https://www.youtube.com/watch?v=UhZGYS13twc">Rust Linz, November 2021 - Serde Shenanigans by Armin Ronacher</a></li>
<li>[video] <a href="https://www.youtube.com/watch?v=o6qe4lw9-8c">Rust Linz, November 2021 - WebAssembly beyond the browser by Thorsten Hans</a></li>
<li>[video] <a href="https://www.youtube.com/watch?v=DGbsHENouy4">Mats Kindahl: A C++ programmer's view on Rust</a></li>
</ul>
<h3 id="rust-walkthroughs">Rust Walkthroughs</h3>
<ul>
<li><a href="https://kerkour.com/black-hat-rust-week-2021/">Black Hat Week (Black Hat Rust is out 🍾)</a></li>
<li><a href="https://www.joshfinnie.com/blog/using-webassembly-created-in-rust-for-fast-react-components/">Using WebAssembly (created in Rust) for Fast React Components</a></li>
<li><a href="https://kflansburg.com/posts/rust-cachepot/">Speed up Rust Builds with Cachepot</a></li>
<li><a href="https://levelup.gitconnected.com/how-to-build-a-note-taking-command-line-application-with-rust-part-1-34b9cd5be6b9">How to Build a Note Taking Command Line Application With Rust: Part 1</a></li>
<li><a href="https://www.freecodecamp.org/news/rust-in-replit/">Learn Rust Programming Course – Interactive Rust Language Tutorial on Repl.it</a></li>
<li><a href="https://kerkour.com/rust-position-independent-shellcode/">Position Independent Shellcodes in Rust (PIC)</a></li>
<li><a href="https://medium.com/pragmatic-programmers/run-your-rust-games-in-a-browser-ceea86b04616">Run Your Rust Games in a Browser</a></li>
<li><a href="https://dev.to/calebsander/git-internals-part-2-packfiles-1jg8">Git Internals part 2: packfiles</a></li>
<li><a href="https://dev.to/fndomendez/building-a-simple-on-chain-point-of-sale-with-solana-anchor-and-react-859">Building a simple on-chain point of sale with Solana, Anchor and React</a></li>
<li><a href="https://erayerdin.com/checking-unused-dependencies-in-a-rust-project-with-github-actions-ckwm3yov901cwlvs1h48z54xi">Checking Unused Dependencies in a Rust Project with Github Actions</a></li>
<li>[video] <a href="https://www.youtube.com/watch?v=U_XGkDZcV1k">rg3d - live coding session #3</a></li>
<li>[video] <a href="https://www.youtube.com/watch?v=4y1aRPiH9Ko">The Ray Tracer Challenge - 022 - Planes</a></li>
<li>[PL] [video] <a href="https://www.youtube.com/watch?v=q2lWUmAKsVQ">Rust na raz #2: Ugliest workaround for unsafe</a></li>
</ul>
<h3 id="miscellaneous">Miscellaneous</h3>
<ul>
<li><a href="https://www.theregister.com/2021/11/30/aws_reinvent_rust/">Can Rust save the planet? Why, and why not</a></li>
<p>This week's crate is <a href="https://crates.io/crates/poem-openapi">poem-openapi</a>, a framework to implement OpenAPI services.</p>
<p>llogiq is very pleased with his suggestion.</p>
<p><a href="https://users.rust-lang.org/t/crate-of-the-week/2704">Please submit your suggestions and votes for next week</a>!</p>
<h2 id="call-for-participation">Call for Participation</h2>
<p>Always wanted to contribute to open-source projects but didn't know where to start?
Every week we highlight some tasks from the Rust community for you to pick and get started!</p>
<p>Some of these tasks may also have mentors available, visit the task page for more information.</p>
<ul>
<li><a href="https://github.com/rusty-celery/rusty-celery">rusty-celery is looking for maintainers</a></li>
</ul>
<p><strong>Ockam</strong></p>
<ul>
<li><a href="https://github.com/ockam-network/ockam/issues/2288">Move the ockam_vault_core create into ockam_core</a></li>
<li><a href="https://github.com/ockam-network/ockam/issues/2291">Move the ockam_key_exchange_core create into ockam_core</a></li>
<li><a href="https://github.com/ockam-network/ockam/issues/2287">Delete the ockam_node_no_std crate</a></li>
</ul>
<p>If you are a Rust project owner and are looking for contributors, please submit tasks <a href="https://users.rust-lang.org/t/twir-call-for-participation/4821">here</a>.</p>
<h2 id="updates-from-the-rust-project">Updates from the Rust Project</h2>
<p>244 pull requests were <a href="https://github.com/search?q=is%3Apr+org%3Arust-lang+is%3Amerged+merged%3A2021-11-22..2021-11-29">merged in the last week</a></p>
<ul>
<li><a href="https://github.com/rust-lang/rust/pull/84197">add codegen option for using LLVM stack smash protection</a></li>
<li><a href="https://github.com/rust-lang/compiler-builtins/pull/442">do not use atomic reads on platforms without atomic support in LLVM</a></li>
<li><a href="https://github.com/rust-lang/rust-clippy/pull/8028">clippy: add more descriptive help info for <code>needless_question_mark</code></a></li>
<li><a href="https://github.com/rust-lang/rust-clippy/pull/7980">clippy: fix false positive on <code>if_then_some_else_none</code> with early return</a></li>
<li><a href="https://www.meetup.com/NewSpace-NYC/events/282320805">December 3, 2021 | New York City, NY, US | <strong>Getting started in aerospace with Rust 🦀</strong> | NewSpace NYC</a>.</li>
<li><a href="https://www.meetup.com/Los-Gatos-Rust-Reading-Group/events/281966245">December 8, 2021 | Los Gatos, CA, US | <strong>Book #24 - Rust for Rustaceans - Chapter 1</strong> | Los Gatos Reading Group</a></li>
<li><a href="https://www.meetup.com/Rust-Los-Angeles/events/281944671/">December 8, 2021 | Los Angeles, CA, US | <strong>Rust Computer Vision Project with Geordon Worley</strong> | Rust Los Angeles</a></li>
<li><a href="https://www.meetup.com/Rust-Community-Stuttgart/events/282009864">December 8, 2021 | Stuttgart, DE | <strong>Rust-Meetup</strong> | Rust Community Stuttgart</a></li>
<li><a href="https://www.meetup.com/8th-light-university/events/282381279">December 10, 2021 | Chicago, IL, US | <strong>8LU Keynote by Eric Smith - Write Your Game in Rust!</strong> | 8th Light University</a></li>
<p>If you are running a Rust event please add it to the <a href="https://www.google.com/calendar/embed?src=apd9vmbc22egenmtu5l6c5jbfc%40group.calendar.google.com">calendar</a> to get
it mentioned here. Please remember to add a link to the event too.
Email the <a href="mailto:community-team@rust-lang.org">Rust Community Team</a> for access.</p>
<p><em>Tweet us at <a href="https://twitter.com/ThisWeekInRust">@ThisWeekInRust</a> to get your job offers listed here!</em></p>
<h1 id="quote-of-the-week">Quote of the Week</h1>
<blockquote>
<p>The design of the safe/unsafe split means that there is an asymmetric trust relationship between Safe and Unsafe Rust. Safe Rust inherently has to trust that any Unsafe Rust it touches has been written correctly. On the other hand, Unsafe Rust cannot trust Safe Rust without care.</p>
<p>As an example, Rust has the <a href="https://doc.rust-lang.org/nightly/std/cmp/trait.PartialOrd.html"><code>PartialOrd</code></a> and <a href="https://doc.rust-lang.org/nightly/std/cmp/trait.Ord.html"><code>Ord</code></a> traits to differentiate between types which can "just" be compared, and those that provide a "total" ordering (which basically means that comparison behaves reasonably).</p>
<p><a href="https://doc.rust-lang.org/nightly/std/collections/struct.BTreeMap.html"><code>BTreeMap</code></a> doesn't really make sense for partially-ordered types, and so it requires that its keys implement <code>Ord</code> . However, <code>BTreeMap</code> has Unsafe Rust code inside of its implementation. Because it would be unacceptable for a sloppy <code>Ord</code> implementation (which is Safe to write) to cause Undefined Behavior, the Unsafe code in BTreeMap must be written to be robust against <code>Ord</code> implementations which aren't actually total — even though that's the whole point of requiring <code>Ord</code> .</p>
</blockquote>
<p>– <a href="https://github.com/rust-lang/rfcs/pull/3197#issuecomment-976032253">Gankra citing the Rustonomicon on github</a></p>
<p>Thanks to <a href="https://users.rust-lang.org/t/twir-quote-of-the-week/328/1144">robin</a> for the suggestion!</p>
<p><a href="https://users.rust-lang.org/t/twir-quote-of-the-week/328">Please submit quotes and vote for next week!</a></p>
<!-- SC_OFF --><div class="md"><p>I have a text file on disk containing a valid RFCnnnn email message. It has all of the headers, including <code>From:</code>, <code>To:</code>, <code>References:</code>, and <code>Content-type:</code> (it's a multipart/alternative). One alternative is quoted-printable text/plain, and the other is HTML.</p> <p>Is there anything out there already that will let me look at this arbitrary file as if it were an email, without having to hook it into mailboxes/maildirs/indexers? Just extract that text/html section and render it with SHR, nothing about replying or forwarding. Or strip out the the quoted-printable escapes and refill the paragraphs. It seems like someone somewhere would have already written a package that sits on top of emacs-mime and does this.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/PropagandaOfTheDude"> /u/PropagandaOfTheDude </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/poz3xo/any_way_to_just_render_an_email_file_on_disk/">[link]</a></span>   <span><a href="https://www.reddit.com/r/emacs/comments/poz3xo/any_way_to_just_render_an_email_file_on_disk/">[comments]</a></span>
Updated: [2021-12-09 Thu] comment clarifying “macros” Intro Time to make a new daily event for the next 90 days, but it shouldn’t have weekends. Most of these steps become muscle memory after getting used to emacs macro power in orgmode files, sql dumps, dired find-and-replace, text formatting, YAML/XML/HTML/JSON/EDN tailoring, etc. It’s the speed and flexibility of this method that shines, allowing for solutions to very specific problems, or just nice custom orgmode agenda entries in this case.
<table> <tr><td> <a href="https://www.reddit.com/r/unixporn/comments/r53v6s/xfce_an_updated_version_of_the_windows_95_theme_i/"> <img src="https://preview.redd.it/yw9d4rcz8l281.png?width=640&crop=smart&auto=webp&s=0892fb3e3802b8274aafcb9dd81ac347d27a8332" alt="[XFCE] An updated version of the Windows 95 theme I posted 2 weeks ago" title="[XFCE] An updated version of the Windows 95 theme I posted 2 weeks ago" /> </a> </td><td>   submitted by   <a href="https://www.reddit.com/user/ioletsgo"> /u/ioletsgo </a> <br/> <span><a href="https://i.redd.it/yw9d4rcz8l281.png">[link]</a></span>   <span><a href="https://www.reddit.com/r/unixporn/comments/r53v6s/xfce_an_updated_version_of_the_windows_95_theme_i/">[comments]</a></span> </td></tr></table>
<!-- SC_OFF --><div class="md"><p>Title, basically. I know that you need it if you're using Optimus Manager for switchable graphics, but do I need to use gdm-prime if I'm using the Prime Render Offload method from the arch wiki, so I'm not using Optimus Manager? I can't find anywhere that specifies. Thanks!</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/SpoonyBardXIV"> /u/SpoonyBardXIV </a> <br/> <span><a href="https://www.reddit.com/r/archlinux/comments/rseqjg/do_i_need_to_install_gdmprime_if_im_not_using/">[link]</a></span>   <span><a href="https://www.reddit.com/r/archlinux/comments/rseqjg/do_i_need_to_install_gdmprime_if_im_not_using/">[comments]</a></span>
<img src="https://media.babylonbee.com/thumbs/article-10037-1-thumb.jpg"> <p>LOS ANGELES, CA—Local man Mick Paulson was immediately canonized as a Christian saint after he returned his shopping cart to the corral following a grocery shopping trip Friday afternoon.</p>
<p>The post <a rel="nofollow" href="https://babylonbee.com/news/man-immediately-granted-sainthood-after-returning-shopping-cart-to-corral">Man Immediately Granted Sainthood After Returning Shopping Cart To Corral</a> appeared first on <a rel="nofollow" href="https://babylonbee.com">The Babylon Bee</a>.</p>
<!-- SC_OFF --><div class="md"><p>I'm using vterm a lot, and really like entering <code>vterm-copy-mode</code>. However, sometimes (I haven't figured out under what circumstances) the following sequence of commands leads to weird behavior:</p> <ul> <li><p>I enter copy mode</p></li> <li><p>select a word in the middle of a line using the normal emacs commands</p></li> <li><p>yank that word</p></li> <li><p>exit copy mode</p></li> <li><p>paste that word</p></li> </ul> <p>For instance, I use <code>ps</code> to enumerate processes, select a process ID using copy mode, then try to <code>kill $my-selected-id</code>.</p> <p>What happens is the <em>whole line</em> is pasted instead of the single word.</p> <p>Anyone experienced this and has a way to fix this?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/pimiddy"> /u/pimiddy </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/r5l6q2/weird_vterm_copypaste_behavior/">[link]</a></span>   <span><a href="https://www.reddit.com/r/emacs/comments/r5l6q2/weird_vterm_copypaste_behavior/">[comments]</a></span>