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> no. But if I wind up rewriting this tui text library in the next couple months I'd appreciate if I could ask your advice.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> should i get sniped by this for the next half a hour?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> i *think* you can consume that borrow and the string in the operation</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> however, there's still one problem: you need to make sure you don't get wedged in a situation where you have one immutable borrow left, and you want to use exactly that index to tell the string to perform a mutation at a position… but you can't mutate because the index you are "turning in" to request the mutation is holding a borrow. Maybe the borrow checker already has rules smart enough to prevent this being a problem. I am still perpetually surprised by the borrow checker</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> *thinks*</p><p>You're right. I'm thinking about this wrong. Thanks.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> you can have multiple immutable borrows, no?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@film_girl" class="u-url mention">@<span>film_girl</span></a></span> There is always cake at the Sky Club</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> so maybe what would work is an Indexer that can vend multiple live indices and the Indexer holds the borrow? Not sure</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> borrow worries me because many uses of an index stop working with a borrow. For example, what if you want two indices so you can interate over the string twice. Ofc the index idea only works if you can prevent the string from being mutated…</p>