<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Array on rustbites</title><link>https://www.rustbites.com/tags/array/</link><description>Recent content in Array on rustbites</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 06 Aug 2026 14:01:16 +0200</lastBuildDate><atom:link href="https://www.rustbites.com/tags/array/index.xml" rel="self" type="application/rss+xml"/><item><title>296. [T; N]::each_ref — Map Over an Array Without Giving It Away</title><link>https://www.rustbites.com/posts/bite-296/</link><pubDate>Mon, 03 Aug 2026 09:00:00 +0100</pubDate><guid>https://www.rustbites.com/posts/bite-296/</guid><description>&lt;p&gt;&lt;code&gt;arr.map(f)&lt;/code&gt; consumes the array — one call and your data is gone. &lt;code&gt;each_ref()&lt;/code&gt; turns &lt;code&gt;[T; N]&lt;/code&gt; into &lt;code&gt;[&amp;amp;T; N]&lt;/code&gt;, so you can map over borrows and keep the original.&lt;/p&gt;</description></item></channel></rss>