<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: gaurav sharma</title>
    <description>The latest articles on DEV Community by gaurav sharma (@gaurav_sharma_84b39c2de6f).</description>
    <link>https://dev.to/gaurav_sharma_84b39c2de6f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2447282%2Fac9c50f1-60b2-406e-830f-31fc8502e3ca.png</url>
      <title>DEV Community: gaurav sharma</title>
      <link>https://dev.to/gaurav_sharma_84b39c2de6f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gaurav_sharma_84b39c2de6f"/>
    <language>en</language>
    <item>
      <title>Me vs the Rust Compiler: A Daily Ritual of Pain and Progress</title>
      <dc:creator>gaurav sharma</dc:creator>
      <pubDate>Mon, 14 Jul 2025 18:39:51 +0000</pubDate>
      <link>https://dev.to/gaurav_sharma_84b39c2de6f/me-vs-the-rust-compiler-a-daily-ritual-of-pain-and-progress-4a5</link>
      <guid>https://dev.to/gaurav_sharma_84b39c2de6f/me-vs-the-rust-compiler-a-daily-ritual-of-pain-and-progress-4a5</guid>
      <description>&lt;p&gt;cargo check &amp;gt; try / expect / finally 🦀&lt;br&gt;&lt;br&gt;
just pushing my daily rust learnings here.&lt;br&gt;&lt;br&gt;
i wouldn’t call this a project. it’s more like a ritual.&lt;br&gt;&lt;br&gt;
open terminal. write code. fight compiler. give up. try again.&lt;br&gt;&lt;br&gt;
sometimes it works. sometimes i pretend it does.  &lt;/p&gt;

&lt;p&gt;i started this as a place to throw code while i figure out how the hell rust actually works.&lt;br&gt;&lt;br&gt;
i still don’t know. the compiler knows. it always knows.&lt;br&gt;&lt;br&gt;
and it won’t let me forget.  &lt;/p&gt;

&lt;p&gt;there’s no roadmap here.&lt;br&gt;&lt;br&gt;
no folders like &lt;code&gt;src/components/ui/button&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
just files like &lt;code&gt;day_12_trait_bound_wtf.rs&lt;/code&gt; and &lt;code&gt;lifetimes_are_fake.rs&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
maybe one of them does something. maybe they all do nothing.&lt;br&gt;&lt;br&gt;
that’s not the point.  &lt;/p&gt;




&lt;h3&gt;
  
  
  this is a repo for:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;stuff that broke
&lt;/li&gt;
&lt;li&gt;stuff that compiled by accident
&lt;/li&gt;
&lt;li&gt;experiments with traits that definitely shouldn’t work
&lt;/li&gt;
&lt;li&gt;weird &lt;code&gt;impl&amp;lt;T: Trait&amp;gt;&lt;/code&gt; things i don’t remember writing
&lt;/li&gt;
&lt;li&gt;lifetimes i slapped &lt;code&gt;'a&lt;/code&gt; on until the error went away
&lt;/li&gt;
&lt;li&gt;and the occasional moment of “oh. oh wait. i get it now” &lt;em&gt;(i don’t)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;i’ve learned more from compiler errors than from any blog post.&lt;br&gt;&lt;br&gt;
not because they teach — but because they hurt.&lt;br&gt;&lt;br&gt;
they force you to &lt;em&gt;feel&lt;/em&gt; the type system.  &lt;/p&gt;




&lt;h3&gt;
  
  
  rust is like:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;“here, be safe”
&lt;/li&gt;
&lt;li&gt;“but also here’s &lt;code&gt;unsafe&lt;/code&gt;”
&lt;/li&gt;
&lt;li&gt;“and btw, this variable doesn’t live long enough”
&lt;/li&gt;
&lt;li&gt;“and you can’t mutate that”
&lt;/li&gt;
&lt;li&gt;“but you can... if you wrap it in an &lt;code&gt;Rc&amp;lt;RefCell&amp;lt;Mutex&amp;lt;Option&amp;lt;T&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;”
cool. thanks.
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;clippy watches me like a disappointed teacher.&lt;br&gt;&lt;br&gt;
i write something janky, and it just goes  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“consider using &lt;code&gt;.map()&lt;/code&gt; instead of this cursed match expression”  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ok clippy. i’ll do it your way. until it breaks.  &lt;/p&gt;




&lt;p&gt;sometimes the most productive thing i do here is delete code.&lt;br&gt;&lt;br&gt;
like spiritual cleansing. remove the &lt;code&gt;Box&lt;/code&gt;, gain inner peace.  &lt;/p&gt;

&lt;p&gt;i don’t know if this is a learning repo. or a dumping ground. maybe both.&lt;br&gt;&lt;br&gt;
it’s not clean. it’s not idiomatic. it’s just me vs the compiler.&lt;br&gt;&lt;br&gt;
and the compiler is winning.  &lt;/p&gt;




&lt;p&gt;dig through the files, open random &lt;code&gt;.rs&lt;/code&gt; files like you're defusing a bomb.&lt;br&gt;&lt;br&gt;
but don’t ask what anything does — i’m still negotiating with the compiler myself.  &lt;/p&gt;

&lt;p&gt;this repo isn’t finished. it never will be.&lt;br&gt;&lt;br&gt;
because in rust, the moment you think you’re done,&lt;br&gt;&lt;br&gt;
the borrow checker reminds you: &lt;strong&gt;you’re not.&lt;/strong&gt;  &lt;/p&gt;




&lt;h3&gt;
  
  
  things rust has taught me
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;ownership is real and it hurts
&lt;/li&gt;
&lt;li&gt;everything is a reference to a reference to a reference
&lt;/li&gt;
&lt;li&gt;if your code compiles, you're already better than yesterday
&lt;/li&gt;
&lt;li&gt;the borrow checker isn’t a bug. it’s a therapist
&lt;/li&gt;
&lt;li&gt;sometimes &lt;code&gt;unwrap()&lt;/code&gt; is self-care
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;match&lt;/code&gt; is both a control flow and a coping mechanism
&lt;/li&gt;
&lt;li&gt;lifetimes aren’t real, but the trauma is
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;String&lt;/code&gt; and &lt;code&gt;&amp;amp;str&lt;/code&gt; are different. always. forever. painfully.
&lt;/li&gt;
&lt;li&gt;cloning everything feels wrong, but silence from the compiler feels right
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt; is a relationship — you need to handle it with care
&lt;/li&gt;
&lt;li&gt;async in rust? no. i still need to heal from lifetimes first
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;impl&amp;lt;T: Trait&amp;gt;&lt;/code&gt; looks harmless until it multiplies
&lt;/li&gt;
&lt;li&gt;sometimes you don’t fix the bug — you just write around it&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  things clippy has said to me
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;“you could simplify this with &lt;code&gt;.map()&lt;/code&gt;”&lt;br&gt;&lt;br&gt;
i could also go outside. but here we are.  &lt;/p&gt;

&lt;p&gt;“this match can be written more cleanly”&lt;br&gt;&lt;br&gt;
so can my life, clippy.  &lt;/p&gt;

&lt;p&gt;“warning: this function has too many arguments”&lt;br&gt;&lt;br&gt;
warning: this function has too many emotions.  &lt;/p&gt;

&lt;p&gt;“consider removing this unnecessary clone”&lt;br&gt;&lt;br&gt;
it’s not unnecessary. it’s emotional support.  &lt;/p&gt;

&lt;p&gt;“variable name &lt;code&gt;x&lt;/code&gt; is not descriptive”&lt;br&gt;&lt;br&gt;
it stands for existential crisis, clippy.  &lt;/p&gt;

&lt;p&gt;“this method returns &lt;code&gt;Result&lt;/code&gt;, but the error is never handled”&lt;br&gt;&lt;br&gt;
neither are my feelings, but here we are.  &lt;/p&gt;

&lt;p&gt;“expression could be simplified with a let chain”&lt;br&gt;&lt;br&gt;
i could be simplified with therapy.  &lt;/p&gt;

&lt;p&gt;“you might want to split this function into smaller parts”&lt;br&gt;&lt;br&gt;
me too, clippy. me too.  &lt;/p&gt;

&lt;p&gt;“you can remove this &lt;code&gt;mut&lt;/code&gt;”&lt;br&gt;&lt;br&gt;
but i’m already too deep in the mutable lifestyle.  &lt;/p&gt;

&lt;p&gt;“this block is empty”&lt;br&gt;&lt;br&gt;
so is my soul, clippy.  &lt;/p&gt;

&lt;p&gt;“you’ve defined this struct, but it’s never used”&lt;br&gt;&lt;br&gt;
story of my career.  &lt;/p&gt;
&lt;/blockquote&gt;




</description>
      <category>rust</category>
      <category>programming</category>
      <category>devjournal</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
