<?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: Shaurya</title>
    <description>The latest articles on DEV Community by Shaurya (@coolshaurya).</description>
    <link>https://dev.to/coolshaurya</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%2F72384%2F35724fd7-4e98-4119-9b63-517511ded93c.png</url>
      <title>DEV Community: Shaurya</title>
      <link>https://dev.to/coolshaurya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/coolshaurya"/>
    <language>en</language>
    <item>
      <title>Flexible trait function parameter names in Rust</title>
      <dc:creator>Shaurya</dc:creator>
      <pubDate>Sun, 12 Apr 2020 03:08:47 +0000</pubDate>
      <link>https://dev.to/coolshaurya/flexible-trait-function-parameter-names-in-rust-7go</link>
      <guid>https://dev.to/coolshaurya/flexible-trait-function-parameter-names-in-rust-7go</guid>
      <description>&lt;p&gt;When we define a trait we give it a function statement of the form &lt;code&gt;fn blah(foo: Bar)&lt;/code&gt;. But when implementing this trait the parameter name (here it is &lt;code&gt;foo&lt;/code&gt;) can be changed as you wish. So let's have an example. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://play.rust-lang.org/?version=stable&amp;amp;mode=debug&amp;amp;edition=2018&amp;amp;gist=d87ab50ead14e8fe1aeb96b60b80a782"&gt;Playground&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c"&gt;/// A very simple struct&lt;/span&gt;
&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Simple&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c"&gt;/// A struct that doesn't matter&lt;/span&gt;
&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Whatever&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;/// A trait that does something _very_ complex&lt;/span&gt;
&lt;span class="k"&gt;trait&lt;/span&gt; &lt;span class="n"&gt;SuperDuperComplexThing&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;do_super_duper_complex_thing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;some_extremely_and_needlessly_long_parameter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Whatever&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Whatever&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;impl&lt;/span&gt; &lt;span class="n"&gt;SuperDuperComplexThing&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;Simple&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;do_super_duper_complex_thing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;simple_param&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Whatever&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Whatever&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Whatever&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this works perfectly. It compiles.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>traits</category>
    </item>
    <item>
      <title>What is the difference between parsing and serialization? </title>
      <dc:creator>Shaurya</dc:creator>
      <pubDate>Wed, 04 Mar 2020 00:20:43 +0000</pubDate>
      <link>https://dev.to/coolshaurya/what-is-the-difference-between-parsing-and-serialization-543b</link>
      <guid>https://dev.to/coolshaurya/what-is-the-difference-between-parsing-and-serialization-543b</guid>
      <description>&lt;p&gt;So, I've come across both terms and I don't understand how serialization is different than parsing. They seem to be different as I've never read about both in the same context but they seem to be similar as they do roughly the same thing, I think. &lt;/p&gt;

</description>
      <category>parsing</category>
      <category>question</category>
      <category>help</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
