Crate of the Week


I was originally going to criticize if_chain saying people should rewrite their code so you don’t get the rightward drift in the first case, but reading the accompanying blog post I realized I’ve had this exact problem when wanting to write lints or a toy language. That’s a +1 from me.


Linkified, because it took me at least three levels of indirection to find it. Nice read!


I have a crate of the week suggestion! It’s colored. It is a terminal output coloring library. You can use it to color your terminal output, or make it bold, or underline it. It’s easy to use and works like a charm (Unix only).


+1 colored. I’ve moved onto other crates for cross platform requirements for some of my crates that previously used it but it’s a great crate to get your feet wet playing with colors, mocking up color palettes and designs, etc.

Also the developer is very nice :slight_smile:


if_chain looks very similar to Elixir’s “with”.


Do you have a cross platform one to recommend?


I have suggestion, actix, asynchronous actor library for rust.


I use termcolor. Ftr I don’t recommend it at all for experimenting with colors/and or just beginning. the api is very unfriendly and tedious to use imho, but some of that is due to cross platform printing details (and some not). I have the same macro for writing colors more succinctly at the top of every project that uses it :frowning:

Termpainter looks also very cool, and should be cross platform as well, and looks to be interesting compromise between colored and termcolor, but haven’t had chance to experiment with it.

Good luck and have fun!


noisy_float, mentioned in a comment in a recent (and popular) Reddit thread.

/u/kyrenn reply:

You know what, I was actually unaware of noisy_float, that actually looks like almost exactly what I wanted. It even implements all the important num_traits traits, including the Float trait. I actually wish I knew about this before, thank you for showing me that!


I’m surprised that so many people don’t know cargo outdated yet. Everyone should know this. :wink: Let’s spread the word:

$ cargo outdated
Name             Project  Compat  Latest   Kind         Platform
----             -------  ------  ------   ----         --------
clap             2.20.0   2.20.5  2.26.0   Normal       ---
clap->bitflags   0.7.0    ---     0.9.1    Normal       ---


Ooh, cargo outdated looks nice. I would like to submit another for consideration:

cargo license which shows the licenses of all your dependencies


I propose futures-await by @alexcrichton - makes working with async code so much easier.


faster - Zero-overhead, cross-platform, beautiful explicit SIMD code.


rerast - A tool for transforming Rust code using rules.


failure - a new error management story.


I’d like to have both faster and failure as creates of the week. So I’d suggest that maybe one could be published in one week and the other the next week.


Same here, thanks for the awesome batch of suggestions @nasa42!


How about we just post it as

This week, the community wants to promote: Faster failure.

and leave if to readers to discover these are actually two links to crates? :wink:


Considering how so many websites, whether high-profile or hobbyist, are still hacked by fairly trivial XSS and other injection attacks, I believe the Ammonia HTML sanitizer deserves a bit of spotlight!

They just now announced reaching a stable 1.0.0.

If you use Cargo, you’ve benefited from it already, as it powers the HTML sanitising behind

Ammonia goes stable, releases version 1.0.0 with backwards compatibility promise

ternimal - Simulate a lifeform in the terminal.