<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pitfall on rustbites</title><link>https://www.rustbites.com/tags/pitfall/</link><description>Recent content in Pitfall on rustbites</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 20 Jul 2026 22:04:45 +0200</lastBuildDate><atom:link href="https://www.rustbites.com/tags/pitfall/index.xml" rel="self" type="application/rss+xml"/><item><title>268. fs::read_dir — The Filesystem Doesn't Sort for You</title><link>https://www.rustbites.com/posts/bite-268/</link><pubDate>Sun, 19 Jul 2026 09:00:00 +0100</pubDate><guid>https://www.rustbites.com/posts/bite-268/</guid><description>&lt;p&gt;&lt;code&gt;fs::read_dir&lt;/code&gt; looks like &lt;code&gt;ls&lt;/code&gt;, but &lt;code&gt;ls&lt;/code&gt; sorts its output and &lt;code&gt;read_dir&lt;/code&gt; doesn&amp;rsquo;t. You get entries in whatever order the filesystem feels like — and that order changes between machines.&lt;/p&gt;</description></item><item><title>265. Path::strip_prefix — Compare Paths by Component, Not by Character</title><link>https://www.rustbites.com/posts/bite-265/</link><pubDate>Fri, 17 Jul 2026 17:00:00 +0100</pubDate><guid>https://www.rustbites.com/posts/bite-265/</guid><description>&lt;p&gt;Checking &lt;code&gt;path_str.starts_with(&amp;quot;/srv/uploads&amp;quot;)&lt;/code&gt; says yes to &lt;code&gt;/srv/uploads-old&lt;/code&gt; too. Paths need component-wise comparison — and &lt;code&gt;Path&lt;/code&gt; has it built in.&lt;/p&gt;</description></item><item><title>264. Path::join — One Absolute Path and Your Base Directory Is Gone</title><link>https://www.rustbites.com/posts/bite-264/</link><pubDate>Fri, 17 Jul 2026 09:00:00 +0100</pubDate><guid>https://www.rustbites.com/posts/bite-264/</guid><description>&lt;p&gt;&lt;code&gt;base.join(user_input)&lt;/code&gt; looks like it appends. But if the input starts with &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;join&lt;/code&gt; silently throws your base away and returns the input alone.&lt;/p&gt;</description></item></channel></rss>