<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rust on Keyboard And Me</title><link>https://weiwei-github-io.vercel.app/tags/rust/</link><description>Recent content in Rust on Keyboard And Me</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 01 Jun 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://weiwei-github-io.vercel.app/tags/rust/index.xml" rel="self" type="application/rss+xml"/><item><title>Learning Rust 01</title><link>https://weiwei-github-io.vercel.app/posts/old-articles/2021-learning-rust-01/</link><pubDate>Tue, 01 Jun 2021 00:00:00 +0000</pubDate><guid>https://weiwei-github-io.vercel.app/posts/old-articles/2021-learning-rust-01/</guid><description>&lt;p&gt;Recently I&amp;rsquo;m trying to learn rust by rewriting one of my typescript libraries into rust. The purpose of the articles is that I record myself sorting things out and trying to understand stuff. They are mostly memos or notes that I serve myself. Though i&amp;rsquo;d be glad if you find it interesting, and even happier if you could point out errors and directions. Cheers.&lt;/p&gt;
&lt;p&gt;The project I&amp;rsquo;m rewriting is &lt;a href="https://www.npmjs.com/package/silabacion" class="external-link" target="_blank" rel="noopener"&gt;silabacion&lt;/a&gt;. It divides Spanish words into syllables, and tries to provide as many phonetic features as possible. There isn&amp;rsquo;t much about it, just lots of string manipulation and pattern matching. It should be a good exercise to rewrite it with rust, and the result could be useful for those 5 people who process Spanish words with rust, so why not?&lt;/p&gt;</description></item><item><title>Learning Rust 02</title><link>https://weiwei-github-io.vercel.app/posts/old-articles/2021-learning-rust-02/</link><pubDate>Tue, 01 Jun 2021 00:00:00 +0000</pubDate><guid>https://weiwei-github-io.vercel.app/posts/old-articles/2021-learning-rust-02/</guid><description>&lt;p&gt;Today I found an implementation of &lt;code&gt;is_vowel&lt;/code&gt; by &lt;a href="https://github.com/BartMassey/is-vowel" class="external-link" target="_blank" rel="noopener"&gt;BartMassey&lt;/a&gt;. It&amp;rsquo;s a much advanced implementation. I&amp;rsquo;ll try to analyze the code. Bear in mind that there is still much that I don&amp;rsquo;t know or understand.&lt;/p&gt;
&lt;h2 id="external-dependencies"&gt;
 External dependencies
 &lt;a class="heading-link" href="#external-dependencies"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Cargo.toml&lt;/code&gt; indicates that two external dependencies are used:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/matklad/once_cell" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;once_cell&lt;/code&gt;&lt;/a&gt; that provides cell-like types.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/unicode-rs/unicode-normalization" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;unicode-normalization&lt;/code&gt;&lt;/a&gt; that does what the name says.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What is a cell-like type? See &lt;a href="https://doc.rust-lang.org/std/cell/" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;std::cell&lt;/code&gt;&lt;/a&gt;. It&amp;rsquo;s &amp;ldquo;shareable mutable container&amp;rdquo;, and the rest is a blur. I think I&amp;rsquo;ll revisit it later.&lt;/p&gt;</description></item></channel></rss>