Whole-known-network
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> <span class="h-card" translate="no"><a href="https://discuss.systems/@pkhuong" class="u-url mention">@<span>pkhuong</span></a></span> mmm… i misread what this was doing</p>
<p>I am writing Rust.</p><p>The code on the left compiles.</p><p>The code on the right does not compile. It produces the error on the righter right.</p><p>Why? how is it possible that rearranging code like this could make such a substantial difference?</p><p>My assumption is in a C-shaped languages expressions are executed from inner to outer. Neither of the types of the self. functions return a reference type.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> <span class="h-card" translate="no"><a href="https://discuss.systems/@pkhuong" class="u-url mention">@<span>pkhuong</span></a></span> the index array?</p>
<p><span class="h-card" translate="no"><a href="https://discuss.systems/@pkhuong" class="u-url mention">@<span>pkhuong</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> Thanks… should this be expected to misbehave if the index array contains duplicates?</p>
<p><span class="h-card" translate="no"><a href="https://discuss.systems/@pkhuong" class="u-url mention">@<span>pkhuong</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> oh wiiild this is super useful thanks :D</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> Or <a href="https://doc.rust-lang.org/std/cell/struct.Cell.html#method.as_slice_of_cells" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="ellipsis">doc.rust-lang.org/std/cell/str</span><span class="invisible">uct.Cell.html#method.as_slice_of_cells</span></a></p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> split_mut i suspect</p>
<p>I do believe it is the only currently viable option for a C-like¹ language but *wow* writing Rust is occasionally absolutely absurd</p><p>¹ Please understand I am using this term in a very constrained way</p>
<p>My short review of The Dawn of Everything <a href="https://softwaremaniacs.org/blog/2025/03/06/the-dawn-of-everything/en/" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">softwaremaniacs.org/blog/2025/</span><span class="invisible">03/06/the-dawn-of-everything/en/</span></a></p>